convert numbers

G

Guest

Hi,

Would you please show me how to convert numbers to age or birthday date?

Ex: I would like to convert 5181965 to 05/18/1965 or 42 (age)
Thank you
Chi
 
G

Guest

Try out this formula from Chip Pearson's Web page. The formula assumes that
the date value is in cell A2:

=DATEDIF(A2,TODAY(),"y")&" years, "&DATEDIF(A2,TODAY(),"ym")&" months,
"&DATEDIF(A2,TODAY(),"md")&" days"

To get additional information regarding date math go the Chip's site at the
following URL:

http://www.cpearson.com/excel/datearith.htm
 
P

Peo Sjoblom

data>text to columns, click next twice then under column data format select
date and MDY and click finish, when the conversion is done use

=DATEDIF(A2,TODAY(),"y")

where A2 is the cell with the converted number


--


Regards,


Peo Sjoblom
 
G

Guest

To make a date:

=DATE(RIGHT(A1,4),LEFT(TEXT(A1,"00000000"),2),MID(TEXT(A1,"00000000"),3,2))
 
G

Guest

Thank you for all responds!

Hi Peo,

It works!!! Thanks. However, in my excel sheet some numbers (cells) were not
converted. I think because the formula works with 8 digits, but not 7.

EX: 10221968 became 10/22/1968. It is perfect! However, the numbers,
9111966, wasn't converted. I tried to add 0 to it so it will become 09111966.
Excel deleted the 0 as soon as I added it in the cell. Would you show me how
to add 0 in all cells?


--------------------

Would you also show me how to convert the birthday date to age please?

Is there a way to make it works?

Thanks
 
P

Peo Sjoblom

If you precede the entry with an apostrophe ' so you always use 8 (or 6
digits if you use mmddyy)
it will work and it will return 09/11/1966

or use the formula

=TEXT(A1,"00\/00\/0000")

or to get a real numerical date

=--TEXT(A7,"00\/00\/0000")

and format the cell as mm/dd/yyyy


--


Regards,


Peo Sjoblom
 
D

David Biddulph

If you have a number of 7 digit cells, you can use the formula ="0"&A2 to
add the leading zero. Copy the results and use Edit/ Paste Special/ Values
to paste the value (text string) in place of the formula. You can then use
the Data/ Text to Columns on that 8 digit text string.
 
G

Guest

Hi Teethless,

Excellent!!! Thank you so much. I also thank to Kenvin B, Peo, David and
Gary!!
Chi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

print 5
sorting by dates -- parameters? 1
Convert date to age 2
Convert date to Age 3
Calculate birth date from age 4
Matching numbers 10
advance number by 1 when compared 2
Excel-formatting 16

Top