Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
using excel 2003. try to calculate age from date of birth and another date.
|
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
In case you want to do some reading while you wait for an answer ......
http://www.cpearson.com/excel/datedif.htm#Age Epinn "jan" wrote in message ... using excel 2003. try to calculate age from date of birth and another date. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
From the link:
Calculating A Person's Age A frequent use of the DATEDIF is to compute someone's age based on the current date and their birthday. The formula below will return someone's exact age based on their birthday in cell A1. =DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " & DATEDIF(A1,NOW(),"md") & " days" This will return a string like 33 years, 9 months, 18 days "Epinn" wrote in message ... In case you want to do some reading while you wait for an answer ...... http://www.cpearson.com/excel/datedif.htm#Age Epinn "jan" wrote in message ... using excel 2003. try to calculate age from date of birth and another date. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'm not sure why Chip used NOW() instead of TODAY(), and by having it
in the formula 3 times, surely this will take longer to calculate than once in a cell (I know you are keen on timings in formulae, Epinn). Pete Epinn wrote: From the link: Calculating A Person's Age A frequent use of the DATEDIF is to compute someone's age based on the current date and their birthday. The formula below will return someone's exact age based on their birthday in cell A1. =DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " & DATEDIF(A1,NOW(),"md") & " days" This will return a string like 33 years, 9 months, 18 days "Epinn" wrote in message ... In case you want to do some reading while you wait for an answer ...... http://www.cpearson.com/excel/datedif.htm#Age Epinn "jan" wrote in message ... using excel 2003. try to calculate age from date of birth and another date. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
So how would you make it faster??? Both Now and Today are volatile so there
is no real advantage to using either one in the context they are being used and the formula is concatenating 3 calculations together so it requires getting the current date 3 times. While you could put Now (or Today) in a seperate cell any gains in speed by only calculating the value once will be lost in the fact that you now have 3 references to that volatile cell. -- HTH... Jim Thomlinson "Pete_UK" wrote: I'm not sure why Chip used NOW() instead of TODAY(), and by having it in the formula 3 times, surely this will take longer to calculate than once in a cell (I know you are keen on timings in formulae, Epinn). Pete Epinn wrote: From the link: Calculating A Person's Age A frequent use of the DATEDIF is to compute someone's age based on the current date and their birthday. The formula below will return someone's exact age based on their birthday in cell A1. =DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " & DATEDIF(A1,NOW(),"md") & " days" This will return a string like 33 years, 9 months, 18 days "Epinn" wrote in message ... In case you want to do some reading while you wait for an answer ...... http://www.cpearson.com/excel/datedif.htm#Age Epinn "jan" wrote in message ... using excel 2003. try to calculate age from date of birth and another date. |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Purely out of idle curriosity I bench marked both your function and Chips
using both Today and Now. Calculated 100,000 times the functions randomly took between 15 and 25 seconds to calculate, with no significant differences between the different methods... The moral of the story is do it how ever you want... -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: So how would you make it faster??? Both Now and Today are volatile so there is no real advantage to using either one in the context they are being used and the formula is concatenating 3 calculations together so it requires getting the current date 3 times. While you could put Now (or Today) in a seperate cell any gains in speed by only calculating the value once will be lost in the fact that you now have 3 references to that volatile cell. -- HTH... Jim Thomlinson "Pete_UK" wrote: I'm not sure why Chip used NOW() instead of TODAY(), and by having it in the formula 3 times, surely this will take longer to calculate than once in a cell (I know you are keen on timings in formulae, Epinn). Pete Epinn wrote: From the link: Calculating A Person's Age A frequent use of the DATEDIF is to compute someone's age based on the current date and their birthday. The formula below will return someone's exact age based on their birthday in cell A1. =DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months, " & DATEDIF(A1,NOW(),"md") & " days" This will return a string like 33 years, 9 months, 18 days "Epinn" wrote in message ... In case you want to do some reading while you wait for an answer ...... http://www.cpearson.com/excel/datedif.htm#Age Epinn "jan" wrote in message ... using excel 2003. try to calculate age from date of birth and another date. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
calculate age from 2 dates in yy,mm,dd format in excel | Excel Worksheet Functions | |||
how to change format of several dates entered in an Excel column | New Users to Excel | |||
Format text 'dates' to real dates | Excel Worksheet Functions | |||
Ensure dates imported into Excel 2003 are shown in DD/MM/YYY form. | Excel Discussion (Misc queries) | |||
how do I get excel to format dates before 1 jan 1900 | Excel Discussion (Misc queries) |