Days between 2 dates

N

Nicky

I want to find out how old a person is.
A1 is todays date 2007/2/22 and A2 is their birthday 1975/04/22.Both cells
are in date format.I say A1-A2 the answer appears as a date and when I change
it to a number I get 11629 which is WRONG. It should equal 31.
Pls help!
 
M

Mike

=DATEDIF(A2,A1,"Y") & " Years, " & DATEDIF(A2,A1,"YM") & " Months, " &
DATEDIF(A2,A1,"MD") & " Days"

Would this do?
 
M

Mike

They both work perfectly so it may be a format issue in your cells A1 & A2.
Ensure these are both formatted as dates and the cell with these formula in
is formatted as general.

Mike
 
N

Nicky

Ah ha! I accidentally deleted the &" Years old" part of the second suggestion
you gave me and it is working. Thanks!
 
D

David Biddulph

Just saying "they haven't worked", in response to the suggestions you
received, doesn't give contributors to the newsgroup much of a clue as to
how to find your error. If you want to get value from the newsgroup, it is
much more useful if you describe the symptoms in a bit more detail.
Although some of the contributors give the impression of being clairvoyant,
most are mere mortals and are helped by some description of the mode of
failure.

Your description of your original problem was OK, but it was a bit strong to
describe the answer as "WRONG". Usually the reason for a "wrong" answer is
that you've asked the wrong question. In your case you'd asked for the
difference between the dates in days, rather than in years, hence the result
you got.
 
Top