Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm trying to find out the formula that will allow someone to enter a child's
birthday in one cell and another cell will compute their age. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
and today's date is in A2
-- Gary''s Student "Millerk" wrote: I'm trying to find out the formula that will allow someone to enter a child's birthday in one cell and another cell will compute their age. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
=DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, " &
DATEDIF(A1,A2,"md") & " days" if the birthday is in A1 -- Gary's Student "Millerk" wrote: I'm trying to find out the formula that will allow someone to enter a child's birthday in one cell and another cell will compute their age. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can put today() in any cell ie a1 then put the date you want ie
02/17/1989 in say a2. Then in b2 put =year(a1)-year(a2). This will give you the age. Be sure to make b2 or the cell the formulars in a number format. John "Millerk" wrote: I'm trying to find out the formula that will allow someone to enter a child's birthday in one cell and another cell will compute their age. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
First, thank you very much for the formula.
Second, how can I set up a condition formula using this formula so that the cell will be yellow 5 days prior to their birthday and red up to 5 days after their birthday. "Gary''s Student" wrote: =DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, " & DATEDIF(A1,A2,"md") & " days" if the birthday is in A1 -- Gary's Student "Millerk" wrote: I'm trying to find out the formula that will allow someone to enter a child's birthday in one cell and another cell will compute their age. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I used the following formula to compute the DOB in order to not have to use
multiple cells. =DATEDIF(C5,NOW(),"y") where C5 has DOB and formula is in D5 The problem with this is that if nothing is entered in C5 then it gives me a solution of 106 instead of leaving it blank. What am I doing wrong here? "Gary''s Student" wrote: =DATEDIF(A1,A2,"y") & " years, " & DATEDIF(A1,A2,"ym") & " months, " & DATEDIF(A1,A2,"md") & " days" if the birthday is in A1 -- Gary's Student "Millerk" wrote: I'm trying to find out the formula that will allow someone to enter a child's birthday in one cell and another cell will compute their age. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Why wouldn't =(NOW()-A1)/365 work. It does not account
for leap years, but how accurate do you need to be? |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dates are stored in Excel as the number of days elapsed since some
reference date - the date is 31st December 1899. So, if C5 is empty, there are 106 years between the reference date and today. To guard against this you could have something like: =IF(C5=0,0,DATEDIF(C5,NOW(),"y")) Hope this helps. Pete |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Pete,
Thanks for the formula. I fooled around with it after I posted the question and came up with a very similar formula that seems to be working. =IF(C5="","",DATEDIF(C5,NOW(),"y")) I guess the ""= 0 in this case. Thanks for the response. "Pete_UK" wrote: Dates are stored in Excel as the number of days elapsed since some reference date - the date is 31st December 1899. So, if C5 is empty, there are 106 years between the reference date and today. To guard against this you could have something like: =IF(C5=0,0,DATEDIF(C5,NOW(),"y")) Hope this helps. Pete |
#10
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for feeding back, glad you got it working.
Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Match then lookup | Excel Worksheet Functions | |||
How do I enter formula for < or numbers. | Excel Worksheet Functions | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
Proper way to enter array formula | Excel Worksheet Functions | |||
Can you enter a formula in a cell to run a macro? | Excel Worksheet Functions |