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 toB7 - 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"
A21250The value in A2.
ISNUMBER(A2)TRUEISNUMBER: TRUE if the value is a number.- value
A21250
- value
ISTEXT(A2)FALSEISTEXT: TRUE if the value is text.- value
A21250
- value
IF(ISTEXT(A2),"Text","Blank")"Blank"not usedIF: Returns one value if a test is true, another if false.- logical_test
ISTEXT(A2)FALSE - value_if_true
"Text"not used - value_if_false
"Blank"
- logical_test
IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank"))"Number"IF: Returns one value if a test is true, another if false.- logical_test
ISNUMBER(A2)TRUE - value_if_true
"Number" - value_if_false
IF(ISTEXT(A2),"Text","Blank")"Blank"not used
- logical_test
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.
| Formula | Result | When to use it |
|---|---|---|
| =ISTEXT(A2) | FALSE, TRUE, FALSE…Different result | Just 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
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.