converting string in dd/mm/yyyy format to dat in mm/dd/yyyy format

hy2934

New Member
Joined
Mar 16, 2015
Messages
2
Hi All,

I am a newbie here and would like to apologize in advance if this question has already been answered before (If yes, please direct me to link as I couldn't find it via search)

My problem: I get regular data that I import in excel. Column A is always date but in dd/mm/yyyy format (my regional date setting is USA), and I wish to create another column (B) that has the corresponding date in mm/dd/yyyy format that I can then export to a different software.

I have tried to copy/paste column A to B, then format cells-> mm/dd/yyyy .. this didnt work. I have even tried to format column A by the method above and it doesnt change anything which leads me to believe that when I import data in excel, it treats it as string (or text)

Any idea?

Thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi, if the format in columns A is dd/mm/yyyy use:

Code:
=DATE(RIGHT(A2,4),MID(A2,4,2),LEFT(A2,2))
 
Upvote 0
Sorry, unfortunately without seeing the complete set of data it is difficult to guess. Try this

Code:
=DATE(RIGHT(TEXT(A2,"mm/dd/yyyy"),4),MID(TEXT(A2,"mm/dd/yyyy"),4,2),LEFT(TEXT(A2,"mm/dd/yyyy"),2))

Tested with a few examples, let me know with your database.
 
Upvote 0
When importing (assuming using import from text file Wizard) you should define that column as date (Not General) and define the format. That way the data will import as a date value. Because some values may be out of range for the month expected, Excel is probably switching all to text. Could also be that there are extra spaces included forcing to text (which would also screw up the other listed formulas to convert the data from text to data.)
Is the LEN of each cell ALWAYS 10?
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top