Spreadsheet Practice

How to check if a cell is numeric in Excel

Formula (Excel and Google Sheets)

=IF(ISNUMBER(B2),"OK","Fix")

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

Result on the example
one result per row in C2, filled down to C8
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in C2, filled down to C8. Change any input and the result updates, or edit the formula to experiment.

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.

=IF(ISNUMBER(B2),"OK","Fix")

Result"Fix"

  1. B2(empty)

    The value in B2.

  2. ISNUMBER(B2)FALSE

    ISNUMBER: TRUE if the value is a number.

    • valueB2(empty)
  3. IF(ISNUMBER(B2),"OK","Fix")"Fix"

    IF: Returns one value if a test is true, another if false.

    • logical_testISNUMBER(B2)FALSE
    • value_if_true"OK"not used
    • value_if_false"Fix"

In Google Sheets

The same formula works in Google Sheets: =IF(ISNUMBER(B2),"OK","Fix"). We ran it in Google Sheets mode on the same data and it returns the same results.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=IF(AND(ISNUMBER(B2),B2>0),"OK","Fix")Fix, 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")OK, OK, Fix…Different resultISTEXT 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.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Check if a cell is numeric

In C2, show "OK" when the age is a real number and "Fix" for anything else, including blanks. Fill down to C8.

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).

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.