Link to home
Start Free TrialLog in
Avatar of eureka15
eureka15Flag for United States of America

asked on

Convert number to date

I need help in converting this number to a date    1070922    to  9/22/07     it is a number and not text.
A formula or macro would work. It is in column K.
Avatar of Brian Pringle
Brian Pringle
Flag of United States of America image

Are they always in this format?
Avatar of eureka15

ASKER

yes
I am sure there is a way to do this with with a macro or VBA script, but here is a workaround.

A1: 1072210
B1: =LEFT(RIGHT(A1,6),2)
C1: =LEFT(RIGHT(A1,4),2)
D1: =LEFT(RIGHT(A1,2),2)
E1: =D1&"/"&C1&"/"&B1

You could hide columns B, C, and D if you don't want to see them.
Avatar of byundt
Assuming that 0990922 should be converted into September 22, 1999 and 1071022 into October 22, 2007, you might try:
=DATE(LEFT(A1,3)+1900,MID(A1,4,2),RIGHT(A1,2))
Format the results of the formula as a date.

Brad
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Brad
What can I say...You did it once again!
Would not have even thought of +1900.
Thank You :)