Converting date format?

tQk.Sushi

New Member
Joined
Aug 26, 2011
Messages
11
Hi all,

I have a question about converting dates. Is it possible that when I copy and paste a date onto excel it will convert itself into a different format?

Like for example if I paste the date "Sep 4th 11, 1:14 PM" into Excel that it will convert it into 9/4/11. The reason I'm asking is because the aforementioned date format is not recognized by Excel.

Much thanks
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi all,

I have a question about converting dates. Is it possible that when I copy and paste a date onto excel it will convert itself into a different format?

Like for example if I paste the date "Sep 4th 11, 1:14 PM" into Excel that it will convert it into 9/4/11. The reason I'm asking is because the aforementioned date format is not recognized by Excel.

Much thanks

Set up the entire column with the date format you want, then use right-click and "pastespecial" and select "value" when putting the date in the new column.
 
Upvote 0
You could put this formula in an unused cell on the same row and copy it down as needed...

=--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(A1,FIND(",",A1)-1),"th",","),"st",","),"nd",","),"rd",",")
You could then Copy the cells (with the above formula) and use Paste Special, Values to replace your original "dates" with the real dates the formula generates, then use Format Cells to make the real dates look like you want.
 
Upvote 0
You could put this formula in an unused cell on the same row and copy it down as needed...

=--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(A1,FIND(",",A1)-1),"th",","),"st",","),"nd",","),"rd",",")
You could then Copy the cells (with the above formula) and use Paste Special, Values to replace your original "dates" with the real dates the formula generates, then use Format Cells to make the real dates look like you want.
Not extensively tested but it seems to work and retains the time portion.

=--SUBSTITUTE(SUBSTITUTE(A1,",",""),MID(A1,LOOKUP(50,FIND({"st","nd","rd","th"},A1)),2),",")

I formatted the cells as m/d/yyyy h:mm am/pm.
 
Upvote 0
Not extensively tested but it seems to work and retains the time portion.

=--SUBSTITUTE(SUBSTITUTE(A1,",",""),MID(A1,LOOKUP(50,FIND({"st","nd","rd","th"},A1)),2),",")

Just to point out... I deliberately removed the time portion because of this statement by the OP...

"...if I paste the date "Sep 4th 11, 1:14 PM" into Excel that it will convert it into 9/4/11."
 
Upvote 0
Just to point out... I deliberately removed the time portion because of this statement by the OP...

"...if I paste the date "Sep 4th 11, 1:14 PM" into Excel that it will convert it into 9/4/11."
If they only want the date...

=--INT(SUBSTITUTE(SUBSTITUTE(A1,",",""),MID(A1,LOOKUP(50,FIND({"st","nd","rd","th"},A1)),2),","))

This one is a bit shorter:

=--REPLACE(LEFT(A1,FIND(",",A1)-1),LEN(LEFT(A1,FIND(",",A1)-1))-4,2,",")
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,289
Members
452,902
Latest member
Knuddeluff

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