Calculate Age In Google Sheets

What Is Calculate Age In Google Sheets?

The Calculate Age in Google Sheets helps users to find a person’s age using their date of Birth. We can also find the age in terms of years, months, days, weeks, etc. We do not have a pre-defined Formula to Calculate Age in Google Sheets. So, we can use the TODAY, YEARFRAC or the DATEDIF functions. However, we can use the following Basic Formula to Calculate Age in Google Sheets,

=(Today’s Date-Date of Birth)/365

For example,we can find the age of a person using the Start Date and End Date, as shown below.

Calculate-Age-In-Google-Sheets-Definition

Select cell C2, enter the formula =DATEDIF(A2,B2,”Y”) and press “Enter”.

Calculate-Age-In-Google-Sheets-Definition-1

The output is ‘36’, as shown above.

Key Takeaways
  • The Calculate Age in Google Sheets helps us find the current age using the date of birth or the number of years using the start and the end dates. We can always use the TODAY() function if we do not have the end date.
  • The basic formula to calculate age is (Today’s Date – Date of Birth) / 365. Therefore, Date of Birth is mandatory to calculate the age.
  • We can use a few other functions such as the DATEDIF(), YEARFRAC(), and TODAY() for age calculation.
  • The two dates compared to Calculate Age must be in the valid format or else the same format, else, we will get an error.

How To Calculate Age In Google Sheets?

Since Google Sheets or MS Excel do not have a pre-defined or built-in formula to Calculate Age, we can build formulas ourselves or create a Age Calculating Template in Google Sheets, using some of the functions such as, DATEDIF(), YEARFRAC(), TODAY(), etc.

In this article, we will use the top four ways to Calculate Age In Google Sheets, namely,

  1. Basic Google Sheets Formula for Age in Years.
  2. Calculate Age using the YEARFRAC function.
  3. Calculate Age using the DATEDIF function.
  4. Calculate age Using the Array formula.

Examples

We will consider specific examples for the above-mentioned four methods to Calculate Age in Google Sheets.

Example #1 – Basic Google Sheets Formula for Age in Years –

We will use the Basic Formula to Calculate Age in Google Sheets to find the age in years.

In the following table, the data is,

  1. Column A shows the Name.
  2. Column B contains the Date of Birth.
  3. Column C for the Output [Age].
Calculate-Age-In-Google-Sheets-Example-1

The steps to Calculate Age from Date of Birth using the basic formula are as follows:

Step 1: Select cell C2 and enter the formula =(TODAY()-B2)/365.

Example-1-Step-1

Step 2: Press the “Enter” key. The output is ‘29.43013699’, as shown below.

Example-1-Step-2

Step 3: As the output is a decimal, not an integer, we will enter the INT formula. Then, the updated formula is=INT((TODAY()-B2)/365) and press “Enter”.

[Note: We can also enter the value of days as 365.25 to be precise instead of 365.]

Example-1-Step-3

Now, the exact age is ‘29’, as shown above.

Example #2 – Calculate Age using the YEARFRAC function –

We will first understand the YEARFRAC function.

YEARFRAC function – It calculates the number of whole days between two dates.

The syntax of the YEARFRAC function is,

Calculate-Age-In-Google-Sheets-Example-2

The arguments of the YEARFRAC function are,

·       start_date à It denotes the start date. It is a mandatory argument.

·       end_date à It denotes the end date. It is a mandatory argument.

·       [day_count_convention] à It denotes the dates fraction. It is an optional argument.

We will use the YEARFRAC function to Calculate Age in Google Sheets.

In the following table, the data is,

  • Column A shows the Name.
  • Column B contains the Date of Birth.
  • Column C for the Output [Age].
Calculate-Age-In-Google-Sheets-Example-2-1

The steps to Calculate Age using the YEARFRAC function are as follows:

Step 1: Select cell C2 and enter the =YEARFRAC(B2,TODAY(),1).

Example-2-Step-1

[Note: The start_date, i.e., the DOB, is in cell B2. We will take the end_date as today’s date, so use the Today() function and the [day_count_convention] is‘1].

Step 2: Press the “Enter” key. The output is ’32.83’, as shown in the image below.

Example-2-Step-2

Step 3: Since the age is in decimal we can use the INT function like the previous example. Therefore, the new output will be as shown below.

Example-2-Step-3

Example #3 – Calculate Age using the DATEDIF function –

We must first understand the DATEDIF function to Calculate Age in Google Sheets.

DATEDIF function – It calculates the number of whole days, full months, or full years between two dates.

The syntax of the DATEDIF function is,

Calculate-Age-In-Google-Sheets-Example-3

The three mandatory arguments of the DATEDIF function are,

  • start_date – It is the start date of the period we want to calculate.
  • end_date – It is the end date of the period we want to calculate.
  • unit – It is the time unit we want to calculate.

The Unit table is as follows:

UnitNameExplanation
YYearsSeveral years between the start and end date.
MMonthsNumber of months between start and end date
DDaysNumber of days between start and end date
MDDays excluding year and monthsDate difference in days, excluding months and years.
YDDays excluding yearsDate difference in days, excluding years.
YMMonths excluding days and yearsDate difference in months, excluding days and years.

In the following table, the data is,

  1. Column A shows the Start Date.
  2. Column B contains the End Date.
  3. Column C for the Output [Age].
Calculate Age In Google Sheets-Example-3-1

The procedure to Calculate Age in Google Sheets using the DATEDIF function is:

First, select the column C and enter the formulas along with their units as follows,

  1. In cell C2, enter the formula =DATEDIF(A2,B2,”Y”)
  2. In cell C3, enter the formula =DATEDIF(A3,B3,”M”)
  3. In cell C4, enter the formula =DATEDIF(A4,B4,”D”)
  4. In cell C5, enter the formula =DATEDIF(A5,B5,”MD”)
  5. In cell C6, enter the formula =DATEDIF(A6,B6,”YD”)
  6. In cell C7, enter the formula =DATEDIF(A7,B7,”YM”)
Calculate-Age-In-Google-Sheets-Example-3-2

After entering the formulas in their respective cells, press the “Enter” key.

Calculate-Age-In-Google-Sheets-Example-3-3

We will get the above output shown in Column C. [Note: The results are as per the specified units, w.r.t days, months, years, etc. Column D is for our reference of the applied formulas.]

Example #4 Calculate age Using the Array formula –

In the image below, we have date of birth to calculate the age according to today’s date. We will use the array formula to find the age as per today.

Calculate-Age-In-Google-Sheets-Example-4

Select cell D2, enter the formula =iferror(datedif(date(C2:C,A2:A,B2:B),date(2024,6,3),”Y”))) and press “Enter”, as shown below.

Calculate-Age-In-Google-Sheets-Example-4-1

Now, to execute the formula as an array formula, we must press “Ctrl+Shift+Enter” instead of just the “Enter” key. Then, the formula will become ={ArrayFormula(iferror(datedif(date(C2:C,A2:A,B2:B),date(2024,6,3),”Y”)))}, as shown below.

Calculate-Age-In-Google-Sheets-Example-4-2

We can also modify the formula as follows:

={“Age”;ArrayFormula(iferror(datedif(date(C2:C,A2:A,B2:B),date(2024,6,3),”Y”)))},

Calculate-Age-In-Google-Sheets-Example-4-3

Here, the output is displayed in cell D3 and the Text Age is displayed in the cell D2.

Important Things To Note

  1. If we copy the DATEDIF function to another cell in Google Sheets, we will get the #NUM! or #REF! error or just 0 in the cell. Therefore, we should enter the formula manually or drag it in a dataset, since it is not an inbuilt function in Google Sheets.
  2. We will get the #NUM! error if the end date is less than the start date.
  3. If Google Sheets does not recognize the valid dates, it returns the “#VALUE!” error.

Frequently Asked Questions (FAQs)

1. How to use the DATEDIF and Arithmetic Operations to Calculate Age in Google Sheets?

We will Calculate Age in Google Sheets using the DATEDIF and Arithmetic Operations in Completed and Fractional Months.
In the following table, the data is,
The column A shows the Start date.
Column B contains the End Date.
And, column C is for output [Age].


 FAQ-1
The steps to Calculate Age in Google Sheets, w.r.t months,are as follows:
Step 1: Select cell C2, enter the formula =DATEDIF(A2, B2,“M”) and press “Enter”.

FAQ-1-Step-1
Step 2: Drag the formula from cell C2 to C7 using the fill handle.

FAQ-1-Step-2
We will get the output as shown above i.e., the number of months between the start and end dates.

2. How to Calculate Age from Date of Birth in Google Sheets?

We will Calculate Age in Google Sheets using the CONCATENATE and DATEDIF in Years, Months, and Days.
Therefore, in the following table, the data is,
The column A shows the Start date.
Column B contains the End Date.
And, column C is for output [Age].

FAQ-2
The steps to Calculate Age and display it as a phrase using the CONCATENATE and DATEDIF functions are as follows:
Step 1: Select cell C2, enter the formula =CONCATENATE(DATEDIF(A2,B2,”Y”),”Years “,DATEDIF(A2,B2,”YM”),”Months and “,DATEDIF(A2,B2,”MD”),”Days”) and press “Enter”as shown below.

FAQ-2-Step-1
Step 2: Drag the formula from cell C2 to C7 using the fill handle.

FAQ-2-Step-2
We will get the output shown above. One formula gives the total years, months, and days.

3. Why is the Calculate Age in Google Sheets not working?

A few reasons the Calculate Age in Google Sheets may not work are,
a. The dates entered are both not in the same valid format.
b. If the values are alpha-numeric, text or blank, then we will not be able to calculate the age.
c. The end date is earlier than the start date.

Download Template

This article must help understand Calculate Age in Google Sheets, with its formula and examples. You can download the template here to use it instantly.

Guide to Calculate Age In Google Sheets. Here we use formula to find age using DOB, DATEDIF(), YEARFRAC(), TODAY, examples, working template. You can learn more from the following articles –

ISEVEN In Google Sheets

Header And Footer In Google Sheets

Concatenate In Google Sheets

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *