Calculate Age Using DOB and Interaction Date

Does anyone know how to calculate an age from a person's date of birth and a date of interaction using beast mode? In other words, if a client utilizes a service on 07/08/2019 and their DOB is 09/09/1999, the formula would find the client's age based on the day of the interaction rather than the current date. In Excel, I have successfully used this formula:

=IF(ISBLANK('date of birth'), "Unknown", DATEDIF('date of birth','date of interaction',"Y"))

 

Any assistance would be greatly appreciated.

Comments

  • ST_Superman
    ST_Superman Domo Employee
    ROUND(DATEDIFF(`date of birth`,`date of interaction`) / 365,1)

    This should provide the age of the customer in years, rounded to the nearest tenth.  Although I’m not sure I have the number right, if you get negatives just flip the two date fields

  • FLOOR(DATEDIFF(date of interaction, date of birth ) / 365.25)

    Floor rounds down since age is usually expressed as the completed integer and never rounded up.

    365.25 to account for leap years.