format help

juster21

Well-known Member
Joined
Jun 3, 2005
Messages
867
I have dates as yyyymmdd stored as text. I'm trying to convert them to mmddyyyy using =text(datevalue(A1),"mmddyyyy") but I get an error (#value!).

Can anybody help?
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
Select the column with the dates.

Goto Data>Text to columns...

On the 3rd step chose Date for Column data format and YMD from the dropdown.

You should now have 'real' dates which you can format as you like.
 

juster21

Well-known Member
Joined
Jun 3, 2005
Messages
867
does it matter if these cells start out with the "numbers stored as text" warning?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
I don't know that one, I'm on 2000.

Did you try my suggestion?

I'm assuming you've got dates that Excel isn't recognising as such and wish to change them to 'real' dates.
 

juster21

Well-known Member
Joined
Jun 3, 2005
Messages
867

ADVERTISEMENT

I've got a number such as 20051213 with the green flag in the corner which says "the number in this cell is formatted as text". I tried your suggestion which does change it to the computer recognized number as a date (35694) but then the conversion doesn't work.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
What do you mean 'the conversion doesn't work'?

Do you mean when you try the formula you posted?

If you do, why do you need the formula? You now have a 'real' date value which you can format as you like with Cells>Format...
 

juster21

Well-known Member
Joined
Jun 3, 2005
Messages
867
Thanks Norie.

Have you ever tried something once and it didn't work and then try it again and it does? Well, it worked the second time so, no, I don't need to use my formula. Thanks again!!
 

Watch MrExcel Video

Forum statistics

Threads
1,118,678
Messages
5,573,618
Members
412,539
Latest member
itchy00
Top