# How to check if someone is over 18 from their date of birth in Excel

Count whole years with DATEDIF and compare: =IF(DATEDIF(B2,$F$1,"y")>=18,"Yes","No"), with =TODAY() or an as-of date in F1.

**Excel:** `=IF(DATEDIF(B2,$F$1,"y")>=18,"Yes","No")` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F |
| --- | --- | --- | --- | --- | --- |
| Name | Date of birth | 18 or over? |  | As of | 2026-10-29 |
| Ava | 2008-10-29 |  |  |  |  |
| Ben | 2008-10-30 |  |  |  |  |
| Cleo | 1995-04-12 |  |  |  |  |
| Dan | 2010-02-01 |  |  |  |  |
| Eve | 2007-12-31 |  |  |  |  |
| Finn | 2009-06-15 |  |  |  |  |

Formula in C2, filled to C7: `=IF(DATEDIF(B2,$F$1,"y")>=18,"Yes","No")`

Result: Yes; No; Yes; No; Yes; No

## How it works

DATEDIF with "y" counts complete years between two dates, which is the age. Ava turns 18 on the as-of date itself, so she qualifies; Ben's birthday is one day later, so he is still 17.

## Other ways

- `=IF(EDATE(B2,12*18)<=$F$1,"Yes","No")`: EDATE finds the 18th birthday; if it is on or before the as-of date, the person is 18.
- `=DATEDIF(B2,$F$1,"y")`: The age itself, if you want it on the sheet. (Shows the ages: 18, 17, 31, 16, 18, 17.)

## Common mistakes

- Dividing the days by 365 drifts around birthdays because of leap years. DATEDIF counts whole years correctly.
- A birth date after the as-of date makes DATEDIF return #NUM!.

## Questions

**How do I check against today?**

Use TODAY(): `=IF(DATEDIF(B2,TODAY(),"y")>=18,"Yes","No")`.

**How do I count the adults in the list?**

Count birth dates on or before the date 18 years earlier: `=COUNTIF(B2:B7,"<="&EDATE(F1,-216))`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/check-if-over-18-from-date-of-birth
