# How to check if a cell contains a date in Excel

Real dates are numbers, so `=ISNUMBER(A2)` is TRUE for a date and FALSE for text that only looks like one.

**Excel:** `=ISNUMBER(A2)` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Entry | Is a date? |
| 2026-03-05 |  |
| 3/9/2026 |  |
| 2026-04-01 |  |
| TBD |  |
| 2026-13-01 |  |
| 2026-05-20 |  |

Formula in B2, filled to B7: `=ISNUMBER(A2)`

Result: TRUE; FALSE; TRUE; FALSE; FALSE; TRUE

## How it works

Spreadsheets store real dates as numbers, so ISNUMBER is TRUE for them and FALSE for text that only looks like a date, such as "3/9/2026" imported as text, or an impossible date like "2026-13-01".

## Other ways

- `=IF(ISNUMBER(A2),"Date","Not a date")`: A readable label. (Shows Date or Not a date.)
- `=AND(ISNUMBER(A2),A2>=DATE(2000,1,1),A2<=DATE(2100,12,31))`: Also rejects numbers that are too small or large to be dates in your data, like 42.

## Common mistakes

- Any number passes ISNUMBER, including 42 or a price. Add a range check when the column can hold other numbers.
- Excel has no ISDATE function. CELL("format",A2) returns a code starting with "D" for date-formatted cells, but it checks only the format, not the value.

## Questions

**How do I convert the text dates?**

`=IF(ISNUMBER(A2),A2,DATEVALUE(A2))`.

**How do I highlight cells that aren't real dates?**

Use conditional formatting with the rule `=NOT(ISNUMBER($A2))`.

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-a-cell-contains-a-date
