Subtracting dates from formula

S

Sunnyskies

Morning,

I have got a date October-2006 now I need to subtract from a calculated cell
of an identity number ie.770809345987. So taking the first two digits ie.77
add on 19 to the front and you now get 1977, which I want to subtract from
October-2006 to get the age which in this case should be 29. How can this be
done?
 
J

Jon von der Heyden

Hi Sunnyskies

Assume A1 houses October-2006 and D1 houses 770809345987:
=YEAR(A1)-VALUE(LEFT(D1,2)+1900)

HTH
Jon
 
S

Stefi

Say 770809345987 is in A1
October-2006 is inB1
then
=DATEDIF(DATE("19"&LEFT(A1,2),1,1),B1,"y")

Regards,
Stefi

„Sunnyskies†ezt írta:
 
D

David Biddulph

If you've got your date in A1 and your identity number in A2, try
=YEAR(A1)-(1900+LEFT(A2,2))
 
S

Sunnyskies

Works, thanks.

Jon von der Heyden said:
Hi Sunnyskies

Assume A1 houses October-2006 and D1 houses 770809345987:
=YEAR(A1)-VALUE(LEFT(D1,2)+1900)

HTH
Jon
 
S

Sunnyskies

Works, thanks.

Stefi said:
Say 770809345987 is in A1
October-2006 is inB1
then
=DATEDIF(DATE("19"&LEFT(A1,2),1,1),B1,"y")

Regards,
Stefi

„Sunnyskies†ezt írta:
 
Top