How to Calculate an Age

It seems like something should do easily, but it is not by all means. Fortunately it is with the Advanced Formula Booster.

Solution 1: the classic Age function

When referring to calculating an age, we typically refer to determining a person's age based on their date of birth. This one is easy:

1:{Age}=AGE({BirthDate})-> 38

Solution 2: you want a number of Days

When calculating the duration of a project, we usually want the number of days. This is not more complicated. We need to use the COUNTDAYS function.

1:{Age}=COUNTDAYS({StartDate})-> 55

Typically the COUNTDAYS function takes 2 dates, but if you omit the 2nd one, it defaults to today's date. In other words, the code above is equivalent to this one:

1:{Age}=COUNTDAYS({StartDate}, TODAY())-> 55

Solution 3: you want Months and Days

If you want months and days, we are back to using the AGE function. This time, since we do not want the classic age output, we need to specify the type of data we want out. You can use Y for the number of years, M for the number of months and D for the number of days. Any other character will be returned as is. For instance:

1:{Age}=AGE({StartDate},"M D")-> 14 12

2:{Age}=AGE({StartDate},"M months D days")-> 14 months 12 days

3:{Age}=AGE({StartDate},"M mois D jours")-> 14 mois 12 jours

Solution 4: you want Years, Months and Days

Following what we learned in Solution 3, we could use this formula:

1:{Age}=AGE({BirthDate},"Y Years, M months and D days")-> 38 years, 6 months and 12 days