askvity

How do I calculate age from date of birth in Google Form?

Published in Google Sheets Age 3 mins read

To calculate age from a date of birth collected in a Google Form, you will need to use Google Sheets in conjunction with the form responses and the DATEDIF function. Google Forms does not have a built-in feature to directly calculate age. Here's a breakdown of how to achieve this:

Step-by-Step Guide:

  1. Collect Date of Birth: In your Google Form, ensure you have a question that collects the date of birth of respondents using the 'Date' question type.

  2. Link Form to Google Sheets:

    • Once you have your form set up, you will need to link it to a Google Sheet.
    • Go to your form and select 'Responses'.
    • Click the Google Sheets icon which will either 'create a new spreadsheet' or 'select existing spreadsheet'.
    • A new spreadsheet or existing one will open and your form data will automatically populate.
  3. Use DATEDIF in Google Sheets:

    • In your Google Sheet, find an empty column (e.g., column B if the date of birth is in column A).
    • Enter the following formula in the first row of the new column where you want the age to appear:
      =DATEDIF(A2,TODAY(),"Y")
    • A2 refers to the cell with the first respondent's date of birth. Change this to match the cell where the first date of birth appears in your sheet.
    • TODAY() automatically grabs today's date and uses it as the end date.
    • "Y" means the difference will be calculated in years.
    • Drag the small blue square at the bottom right corner of the cell down to apply the formula to all other rows in the column. This automatically adjusts the cell reference to the appropriate date of birth in each row.

Explanation of DATEDIF Function

The DATEDIF function is the key to calculating age in Google Sheets. It requires three components:

Parameter Description
Start Date The date of birth.
End Date Typically today's date, obtained using TODAY().
Unit of Measure A string indicating the format for the difference. ("Y" for years, "M" for months, "D" for days).

Example

  • If the Date of Birth (DOB) is in cell A2, the formula will look like: =DATEDIF(A2,TODAY(),"Y")
  • The result in the cell would be the age in years as an integer.

Additional Notes

  • The date of birth in column A must be in a date format that Google Sheet can recognise. Ensure it is configured to a date format if the calculation does not work correctly
  • The DATEDIF function provides a rounded-down integer for the age. If you need to calculate age in years and months or other formats, you can consult Google Sheets' documentation.

Using this method, you can efficiently calculate age from date of birth data collected through Google Forms in your linked Google Sheet.

Related Articles