Formatting of the dates

srkj

New Member
Joined
Sep 27, 2011
Messages
13
month/date/year ----> yearmonthdate
05/15/2012 --> 20120515
4/1/12 --->20120401
6/03/12 ---> 20120603
07/05/2012 ---> 20120705

hello

I am trying to convert some dates that can exist in multiple formats into a single representation

the dates can exist in different forms as listed in column A and column B reflects the new format.

any help or tips are appreciated

thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
month/date/year ----> yearmonthdate
05/15/2012 --> 20120515
4/1/12 --->20120401
6/03/12 ---> 20120603
07/05/2012 ---> 20120705

hello

I am trying to convert some dates that can exist in multiple formats into a single representation

the dates can exist in different forms as listed in column A and column B reflects the new format.
Give this formula a try...

=TEXT(A1,"yyyymmdd")
 
Upvote 0
Try:
=YEAR(A2)&TEXT(MONTH(A2),"0#")&TEXT(DAY(A2),"0#")

It does assume that Excel will recognize the cell refrenced as a date

[edit] Withdrawn - Rick &Jonmo's got the better formula. Apparently I wanted to do it the long way :)
 
Upvote 0

Forum statistics

Threads
1,215,632
Messages
6,125,908
Members
449,273
Latest member
mrcsbenson

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