1 Reply Latest reply on Nov 24, 2012 7:24 PM by philmodjunk

    Calculating Age from DOB

    AndrewMuller

      Title

      Calculating Age from DOB

      Post

           In numbers I can use =DATEDIF(--DOB Cell--,NOW(),"Y") to claculate age from date of birth. Being new to FMP12, how can I do this in FMP??

           cheers

           Andy

        • 1. Re: Calculating Age from DOB
          philmodjunk

               Get ( CurrentDate ) - DateOfBirthField

               will compute the age of an individual in days.

               To compute the age in years:

               Let ( [ T = Get (CurrentDate ) ;
                          Yb = Year ( DateOfBirthField ) ;
                          Yt = Year ( T ) ] ;
                          Yt - Yb - ( Date ( Month ( DateOfBirthField ) ; Day ( DateOfBirthField ) ; Yt ) > T )
                     )

               Make sure to make this a field of type calculation and use the storage options button to make this an unstored calculation or it will not correctly update as time passes.