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

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

**Excel:** `=IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank"))` (Every current version)

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

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Amount (imported) | Type |
| 1250 |  |
| 980 |  |
| 45.5 |  |
| 12,000 |  |
|  |  |
| N/A |  |

Formula in B2, filled to B7: `=IF(ISNUMBER(A2),"Number",IF(ISTEXT(A2),"Text","Blank"))`

Result: Number; Text; Number; Text; Blank; Text

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

## Other ways

- `=ISTEXT(A2)`: 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.

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

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