# How to check if a cell is numeric in Excel

Use ISNUMBER inside IF: =IF(ISNUMBER(B2),"OK","Fix"). It is TRUE only for real numbers, not text that looks like one.

**Excel:** `=IF(ISNUMBER(B2),"OK","Fix")` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B | C |
| --- | --- | --- |
| Response | Age entered | Check |
| R-01 |  |  |
| R-02 | 34 |  |
| R-03 | thirty |  |
| R-04 | 27 |  |
| R-05 | N/A |  |
| R-06 | 41 |  |
| R-07 | 58 |  |

Formula in C2, filled to C8: `=IF(ISNUMBER(B2),"OK","Fix")`

Result: Fix; OK; Fix; OK; Fix; Fix; OK

## How it works

ISNUMBER returns TRUE for numbers and dates (which are numbers) and FALSE for text, blanks and errors. R-06's "41" was entered as text, so it is flagged: it would be skipped by SUM and AVERAGE, which is exactly what this check catches.

## Other ways

- `=IF(AND(ISNUMBER(B2),B2>0),"OK","Fix")`: Adds a sanity check that the age is above zero, so a typo like -34 is flagged as well.
- `=IF(ISTEXT(B2),"Fix","OK")`: ISTEXT catches text but treats an empty cell as fine. (R-01, which is empty, shows OK.)

## Common mistakes

- Numbers stored as text ("41") are not numbers. Convert them with `=VALUE(B2)` or `=--B2`.
- Dates and times are numbers, so ISNUMBER is TRUE for them as well.

## Questions

**How do I check if a cell contains any digit at all?**

Search for each digit: `=SUMPRODUCT(--ISNUMBER(SEARCH({0,1,2,3,4,5,6,7,8,9},B2)))>0`.

**How do I check that a whole column is numeric?**

Compare the counts: `=COUNT(B2:B8)=COUNTA(B2:B8)`.

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/if-cell-contains-a-number
