Making a number cell into a date

burnsa9

New Member
Joined
Jul 20, 2017
Messages
11
I am trying to take a date that looks like 20121222 into a date that looks like 2012-12-22. I already tried changing the format to a date format, but that didn't work. Any advice is greatly appreciated!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Various ways to convert that to a date.

If you have a column of values like that you could select the column, goto Data>Text to columns... and check YMD as the column data format on the 3rd step.

If you want a formula here's one.

=TEXT(A1,"0000\/00\/00")+0
 
Upvote 0
I am trying to take a date that looks like 20121222 into a date that looks like 2012-12-22. I already tried changing the format to a date format, but that didn't work. Any advice is greatly appreciated!
I assume you are trying to change those numbers into real Excel dates right in the cells they are in. If so, select the cells with those dates in them, then select the "Data" tab on the Ribbon and click the "Text to Columns" button located in the "Data Tools" panel... when the dialog box appears, click the "Next" button twice (you'll end up on the "Step 3 of 3" dialog page) and then select the "Date" option button and choose "YMD" from its drop down list... click the "Finish" button and your numbers will be real Excel dates. Now you can Custom Format the cells using this Type pattern format...

yyyy-mm-dd


EDIT NOTE: I see Norie posted the same thing I did, but in an abbreviated form. I decided to leave my post up just in case the OP (or a future reader of this thread) is not familiar with the "Text to Columns" dialog and, perhaps, needs the step-by-step instructions that I posted.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,128
Messages
6,129,030
Members
449,482
Latest member
al mugheen

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