To check whether a cell holds a number, use =IF(ISNUMBER(A1),"Yes","No"). ISNUMBER returns TRUE for numbers and FALSE for text, blanks, and errors.
One thing to know up front: Excel stores dates and times as numbers, so ISNUMBER returns TRUE for them too. If you need to tell a real number from a date, check the cell’s format as well: =IF(ISNUMBER(A1),IF(LEFT(CELL("format",A1),1)="D","Date","Number"),"Not a number") — CELL("format",...) returns a code starting with D for any date or time format.
To test a whole range instead of one cell, =SUMPRODUCT(--ISNUMBER(A1:A10)) counts how many cells hold numbers, and =IF(SUMPRODUCT(--ISNUMBER(A1:A10))>0,"Has numbers","None") tests whether any do. And if a value looks like a number but ISNUMBER says no, it’s stored as text — convert it with Data → Text to Columns → Finish, or test with =ISNUMBER(VALUE(A1)).
To check if a cell value is a number or not, you can use IF + ISNUMBER in a combination. In this combination, ISNUMBER tests if a value is a number or not and returns the result as TRUE or FALSE. After that, IF uses that TRUE or FALSE to return a meaningful value in the result.

Formula to Test IF a Cell Value Is a Number
To write this formula, you can use the below steps.
- First, enter the IF function in a cell.
- After that, in the first argument of the IF (logical_test), enter the ISNUMBER function.
- Next, in the ISNUMBER function, refer to the cell where you want to test the number.
- Now, in the [value_if_true] argument, enter Yes, and in the [value_if_false] argument, enter No. You can also use some other meaningful values if you need.
- In the end, enter the closing parenthesis and hit Enter to get the result.

The moment you hit Enter, it returns Yes or No according to the value that you have in the referred cell.
How Does This Formula Work?
As I said, in this formula, we have two functions, IF + ISNUMBER. Here, the “ISNUMBER(A1)” test checks whether the value in cell A1 is a number. It returns TRUE if A1 contains a number (dates included, as Excel stores dates as numbers) and FALSE if it does not (like text, a logical value, an error, or an empty cell).

Then, IF checks the result of the ISNUMBER condition. If the condition is TRUE, it returns the value_if_true (“Yes” in this case). If the condition is FALSE, it returns the value_if_false (“No”).
=IF(ISNUMBER(A1),"Yes","No")
Same Formula in Mac
If you use Excel for Mac, the formula will be the same and can be written using the same functions.

Excel stores a date as a number. And when you have a date in a cell, ISNUMBER will treat that date as a number and return TRUE in the result. I’m trying to find a solution to this problem, as this formula alone can’t tell a number from a date.
One way around it is the CELL function, which returns the number format of a cell. For cells with date formats, the format code starts with “D”, so you can exclude them like this:
=IF(AND(ISNUMBER(A1),LEFT(CELL("format",A1))<>"D"),"Number","Not a Number")
This checks the cell’s format, not its value, so a date formatted as a plain number still counts as a number, and some custom date formats may not return a “D” code.
Other Formula to Check IF Cell has a Number Then…
The below formula will return “Not a Number” if the cell contains text or is empty and “Number” otherwise. But this won’t work perfectly for checking numbers, as it assumes any non-text and non-empty value is a number, which includes dates, Boolean values (TRUE/FALSE) and errors.
=IF(OR(ISTEXT(A1), ISBLANK(A1)), "Not a Number", "Number")
And this formula checks if the value’s data type in cell A1 is a number (where 1 means a number). It returns “Number” for numeric values and “Not a Number” for anything else. Just note that TYPE also returns 1 for an empty cell, so a blank cell shows “Number”.
=IF(TYPE(A1)=1, "Number", "Not a Number")
Use SUMPRODUCT IF a Range has Numeric Values
Now, let’s say you want to test an entire range instead of a single cell. In this case, you can write a formula using SUMPRODUCT and ISNUMBER. Yes, you can use ISNUMBER in combination with SUMPRODUCT to count how many cells in a range contain numbers.

=SUMPRODUCT(--ISNUMBER(A1:A3))
To understand this formula, you need to split it into two parts: ISNUMBER checks each cell in the range to see if it’s a number, returning TRUE for numbers and FALSE for all other values.
The double hyphen (–) converts TRUE and FALSE into 1s and 0s, respectively. And then, SUMPRODUCT sums up these 1s and 0s, giving the total count of cells that contain numbers.
You can get the same count with the COUNT function, which only counts numbers. And to check if every cell in the range has a number, compare that count with the number of rows:
=COUNT(A1:A3)
=IF(COUNT(A1:A3)=ROWS(A1:A3),"All Numbers","Not All Numbers")
Check Numbers Stored as Text
A number that is stored as text, like “25” imported from another system, isn’t a number for ISNUMBER, so the formula returns No. If you want to treat these values as numbers too, convert the value with a double minus first:
=IF(ISNUMBER(--A1),"Number","Not a Number")
The double minus turns “25” into 25, while real text like “abc” gives an error, which ISNUMBER returns as FALSE. An empty cell becomes 0 here, so add A1<>”” with AND if blanks should be “Not a Number”.
Frequently Asked Questions
Why does ISNUMBER return FALSE for a number?
The number is stored as text. You usually see a small green triangle in the corner of the cell. Convert it with Convert to Number from that warning, or use the double-minus formula above.
How do I check if a cell is not a number?
Wrap ISNUMBER in NOT, or simply swap the values in IF:
=IF(NOT(ISNUMBER(A1)),"Not a Number","Number")
Can I highlight the cells that have numbers?
Yes. Select the range, go to Home ➜ Conditional Formatting ➜ New Rule ➜ Use a formula to determine which cells to format, and enter the formula below (for a range that starts at A1):
=ISNUMBER(A1)
Written by
Puneet Gogia
Microsoft MVP — Excel · Founder, Excel Champs
Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.