Spreadsheet Practice

How to check if a cell is a number or text in Excel

Formula (Excel and Google Sheets)

=IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank"))

Use ISNUMBER and ISTEXT: =IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank")) labels each cell.

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

See it work

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

How it works

"980" and "12,000" look like numbers but are stored as text, which is why SUM skips them and lookups fail. ISNUMBER is TRUE only for real numbers (and dates), ISTEXT only for text. Labeling the column shows exactly which values need converting.

=IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank"))

Result"Number"

  1. A21250

    The value in A2.

  2. ISNUMBER(A2)TRUE

    ISNUMBER: TRUE if the value is a number.

    • valueA21250
  3. ISTEXT(A2)FALSE

    ISTEXT: TRUE if the value is text.

    • valueA21250
  4. IF(ISTEXT(A2),"Text","Blank")"Blank"not used

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

    • logical_testISTEXT(A2)FALSE
    • value_if_true"Text"not used
    • value_if_false"Blank"
  5. IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank"))"Number"

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

    • logical_testISNUMBER(A2)TRUE
    • value_if_true"Number"
    • value_if_falseIF(ISTEXT(A2),"Text","Blank")"Blank"not used

In Google Sheets

The same formula works in Google Sheets: =IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank")). 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
=ISTEXT(A2)FALSE, TRUE, FALSE…Different resultJust the test, ready to filter on. TRUE for text, FALSE for numbers and blanks.

Common mistakes

  • Dates are numbers, so ISNUMBER returns TRUE for them.
  • A formula that returns "" counts as text, not blank.

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 a number or text

In B2, show "Number" when the cell holds a real number, "Text" when it holds text and "Blank" when it is empty. Fill down to B7.

Questions

How do I count the numbers stored as text?

Count text cells that convert to numbers: =SUMPRODUCT(ISTEXT(A2:A7)*ISNUMBER(--A2:A7)).

How do I convert them?

Use =VALUE(A2), or select the cells and choose Convert to Number from the warning icon.

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.