Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=DATEDIF(A2,A1,"Y") & " Years, " & DATEDIF(A2,A1,"YM") & " Months, " &
DATEDIF(A2,A1,"MD") & " Days" Would this do? "Nicky" wrote: 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! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
or a bit less detailed
=DATEDIF(A2,A1,"Y")&" Years old" "Nicky" wrote: 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! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Unfortunately neither of them have worked.
"Mike" wrote: or a bit less detailed =DATEDIF(A2,A1,"Y")&" Years old" "Nicky" wrote: 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! |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 "Nicky" wrote: Unfortunately neither of them have worked. "Mike" wrote: or a bit less detailed =DATEDIF(A2,A1,"Y")&" Years old" "Nicky" wrote: 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! |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You did get DAYS. Apparently you want years. Use
=DATEDIF(a2,a1,"Y") -- Don Guillett SalesAid Software "Nicky" wrote in message ... 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! |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Ah ha! I accidentally deleted the &" Years old" part of the second suggestion
you gave me and it is working. Thanks! "Mike" wrote: 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 "Nicky" wrote: Unfortunately neither of them have worked. "Mike" wrote: or a bit less detailed =DATEDIF(A2,A1,"Y")&" Years old" "Nicky" wrote: 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! |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Where are you? Perhaps a semi colon instead of a comma
-- Don Guillett SalesAid Software "Nicky" wrote in message ... Unfortunately neither of them have worked. "Mike" wrote: or a bit less detailed =DATEDIF(A2,A1,"Y")&" Years old" "Nicky" wrote: 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! |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. -- David Biddulph "Nicky" wrote in message ... Unfortunately neither of them have worked. "Mike" wrote: or a bit less detailed =DATEDIF(A2,A1,"Y")&" Years old" "Nicky" wrote: 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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Days between 2 dates | New Users to Excel | |||
days and dates | Excel Discussion (Misc queries) | |||
days between 2 dates | Excel Worksheet Functions | |||
Calculating number of days between two dates that fall between two other dates | Excel Discussion (Misc queries) | |||
Dates / Days | Excel Discussion (Misc queries) |