Article

17 June 2025

Make.com tip #1 - Calculating age from a date of birth in make.com

It's a common challenge - needing to calculate a person's age based on a date of birth. This may be important for obtaining consent where someone is of legal age, attendance at an event for certain audiences, or some other qualification need.

Here's the first of our series of tips on Make.com. We're starting off with a relatively simple one - calculating someone's age.

On its face, this may seem very straightforward - just subtract one date from the other, right? Yes, but there are some nuances. Let me explain.

Firstly, the TL;DR - here's some code you can copy/paste straight into your own modules in Make.com - just swap out my DOB field with your own data…

{{formatDate(now; \ + "YYYY\") - formatDate(parseDate(9.CorrectDOB); \ + "YYYY\") - if(formatDate(now; \ + "MMDD\") < formatDate(parseDate(9.CorrectDOB); \ + "MMDD\"); 1; 0)}}

The details…Here what we're actually doing here if you want to understand how it works.

To calculate age accurately using Australian date format (DD/MM/YYYY), we:

  • Extract the year difference

  • Check if the birthday has occurred so far this year

  • Subtract 1 if it hasn't

Example:

  • DOB: 15/11/2008

  • Today: 13/06/2025

  • Result: Age is 16

How the formula works…

The formula calculates a person’s current age in years from their date of birth, by comparing correctly formatted dates.

Assume the DOB is entered in Australian format:

15/11/2008 → 15 November 2008

Current date: 13/06/2025 → 13 June 2025

  1. parseDate(9.CorrectDOB)

This converts the DOB from a string (15/11/2008) into a Make-compatible date.

Make sure the input format is parsed correctly. If it’s a string, and you need to specify the format, use:

  1. formatDate(now; "YYYY")

Returns the current year:

13/06/2025 → 2025

  1. formatDate(parseDate(9.CorrectDOB); "YYYY")

Returns the birth year:

15/11/2008 → 2008

  1. formatDate(now; "MMDD")

Note: This formula still uses "MMDD" internally, because sorting by month + day works best for determining birthdays in this example), but it handles input in Australian DD/MM/YYYY format.

Gets the current month and day in sortable format:

13/06/2025 → 0613

  1. formatDate(parseDate(9.CorrectDOB); "MMDD")

Gets the birthday’s month and day:

15/11/2008 → 1115

  1. Final Logic

We subtract 1 from the year difference only if today is before their birthday this year.

Bonus

We can also do a quick calculation to determine whether someone is a minor, by just adding 18 years to the DOB using the following and seeing if it is before or after today's date…

{{if(addYears(parseDate(9.CorrectDOB); 18) > now; "Yes"; "No")}}

Voila!

Hope this helps!