Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

microsoft excel courses london - converting date format

Forum home » Delegate support and help forum » Microsoft Excel Training and help » microsoft excel courses london - Converting Date Format

microsoft excel courses london - Converting Date Format

ResolvedVersion Standard

Cecelia has attended:
Excel VBA Intro Intermediate course

Converting Date Format

My question sounds quite silly- I

RE: Converting Date Format

Hi Cecelia

Not a silly question at all. Your challenge is to get a the month/day/year arrangement into day/month/year this can be done using the the text functions to Left, Mid and Replace along with & for concatenation or joining together.

First you need to format the column or rows that contain the dates to a day/month/year format. The custom format for this in the type box is dd mm yyyy.

Your cell values that you want to change must be in the mm/dd/yyyy meaning your formula bar should show the value in that format

This is very import because you willl next need to convert your date into that order ie. May 15 2006 is "05/15/2006" in old format however you need it the other way around "15/05/2006".

The folowing steps take place in a seperate cells of course it coud be done as a string in VBA

First step is to use the LEFT function to extract the month ie. "05"(check your function wizard for the arguements used in this function.
This function then needs to be nested in the REPLACE function to replace where the day "15" and the day text is located by using the MID function to place it at the start.

Now you can concatenate with the "&" to rest of the date order dd/mm/yyyy using MID to exact the rest as individual components in the right order

At this stage it is still a text string. To convert it into a value that excel can recongnise as a date use VALUE to encase the whole formula in.

The whole formula is below using b4 as the cell with incorrect date format

=VALUE((REPLACE((LEFT(B4,2)),1,2,MID(B4,4,2))&"/"&MID(B4,1,2)&"/"&MID(B4,7,6)))

I hope this has been of assistance

Regards


BEST Training

RE: Converting Date Format

Many thanks, very clear and helpful indeed!

Excel tip:

Change the Print button so it brings up the Print dialogue box

If you want to bring up the Print dialogue box to check your print settings when you hit the Print button, do the following:

1. Right-click on the toolbar that displays the Print button.

2. Select Customise.

3. Click on the Print button on the toolbar to select it, then hold the left mouse button down and drag the button towards the screen below. The button should come off the toolbar.

4. In the Customise dialogue box on your screen, select the Commands tab.

5. Select File from the Categories list, and then locate the Print... icon (looks like the normal Print button, but the word Print has three dots following it).

6. Click on the Print... icon to select it, then use your left mouse to drag and drop the icon onto the toolbar at the top of the screen.

7. Close the Customise dialogue box.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.