Excel ISNUMBER function with formula examples

The tutorial explains what ISNUMBER in Excel is and provides examples of basic and advanced uses.

The concept of the ISNUMBER function in Excel is very simple - it just checks whether a given value is a number or not. An important point here is that the practical uses of the function go far beyond its basic concept, especially when combined with other functions within larger formulas.

Excel ISNUMBER function

The ISNUMBER function in Excel checks if a cell contains a numerical value or not. It belongs to the group of IS functions.

The function is available in all versions of Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007 and lower.

The ISNUMBER syntax requires just one argument:

=ISNUMBER(value)

Where value is the value you want to test. Usually, it is represented by a cell reference, but you can also supply a real value or nest another function inside ISNUMBER to check the result.

If value is numeric, the function returns TRUE. For anything else (text values, errors, blanks) ISNUMBER returns FALSE.

As an example, let's test values in cells A2 through A6, and we will find out that the first 3 values are numbers and the last two are text:
ISNUMBER function in Excel

2 things you should know about ISNUMBER function in Excel

There are a couple of interesting points to note here:

  • In internal Excel representation, dates and times are numeric values, so the ISNUMBER formula returns TRUE for them (please see B3 and B4 in the screenshot above).
  • For numbers stored as text, the ISNUMBER function returns FALSE (see this example).

Excel ISNUMBER formula examples

The below examples demonstrate a few common and a couple of non-trivial uses of ISNUMBER in Excel.

Check if a value is number

When you have a bunch of values in your worksheet and you want to know which ones are numbers, ISNUMBER is the right function to use.

In this example, the first value is in A2, so we use the below formula to check it, and then drag down the formula to as many cells as needed:

=ISNUMBER(A2)

Checking if a value is number

Please pay attention that although all the values look like numbers, the ISNUMBER formula has returned FALSE for cells A4 and A5, which means those values are numeric strings, i.e. numbers formatted as text. There may be different reasons for this, for example leading zeros, preceding apostrophe, etc. Whatever the reason, Excel does not recognize such values as numbers. So, if your values do not calculate correctly, the first thing for you to check is whether they are really numbers in terms of Excel, and then convert text to number if needed.

Apart from identifying numbers, the Excel ISNUMBER function can also check if a cell contains specific text as part of the content. For this, use ISNUMBER together with the SEARCH function.

In the generic form, the formula looks as follows:

ISNUMBER(SEARCH(substring, cell))

Where substring is the text that you want to find.

As an example, let's check whether the string in A3 contains a specific color, say red:

=ISNUMBER(SEARCH("red", A3))

This formula works nicely for a single cell. But because our sample table (please see below) contains three different colors, writing a separate formula for each one would be the waste of time. Instead, we will refer to the cell containing the color of interest (B2).

=ISNUMBER(SEARCH(B$2, $A3))

For the formula to correctly copy down and to the right, be sure to lock the following coordinates with the $ sign:

  • In substring reference, lock the row (B$2) so that the copied formulas always pick the substrings in row 2. The column reference is relative because we want it to adjust for each column, i.e. when the formula is copied to C3, the substring reference will change to C$2.
  • In the source cell reference, lock the column ($A3) so that all the formulas check the values in column A.

The screenshot below shows the result:
Using ISNUMBER SEARCH formula in Excel

ISNUMBER FIND - case-sensitive formula

As the SEARCH function is case-insensitive, the above formula does not differentiate uppercase and lowercase characters. If you are looking for a case-sensitive formula, use the FIND function rather than SEARCH.

ISNUMBER(FIND(substring, cell))

For our sample dataset, the formula would take this form:

=ISNUMBER(FIND(B$2, $A3))

How this formula works

The formula's logic is quite obvious and easy to follow:

  • The SEARCH / FIND function looks for the substring in the specified cell. If the substring is found, the position of the first character is returned. If the substring is not found, the function produces a #VALUE! error.
  • The ISNUMBER function takes it from there and processes numeric positions. So, if the substring is found and its position is returned as a number, ISNUMBER outputs TRUE. If the substring is not found and a #VALUE! error occurs, ISNUMBER outputs FALSE.

IF ISNUMBER formula

If you aim to get a formula that outputs something other than TRUE or FALSE, use ISNUMBER together with the IF function.

Example 1. Cell contains which text

Taking the previous example further, suppose you want to mark the color of each item with "x" like shown in the table below.

To have this done, simply wrap the ISNUMBER SEARCH formula into the IF statement:

=IF(ISNUMBER(SEARCH(B$2, $A3)), "x", "")

If ISNUMBER returns TRUE, the IF function outputs "x" (or any other value you supply to the value_if_true argument). If ISNUMBER returns FALSE, the IF function outputs an empty string ("").
IF ISNUMBER formula to identify which text a cell contains

Example 2. First character in a cell is number or text

Imagine that you are working with a list of alphanumeric strings and you want to know whether a string's first character is a number or letter.

To build such a formula, we you'll need 4 different functions:

  • The LEFT function extracts the first character from the start of a string, say in cell A2:

    LEFT(A2, 1)

  • Because LEFT belongs to the category of Text functions, its result is always a text string, even if it only contains numbers. Therefore, before checking the extracted character, we need to try to convert it to a number. For this, use either the VALUE function or double unary operator:

    VALUE(LEFT(A2, 1)) or (--LEFT(A2, 1))

  • The ISNUMBER function determines if the extracted character is numeric or not:

    ISNUMBER(VALUE(LEFT(A2, 1)))

  • Based on the ISNUMBER result (TRUE or FALSE), the IF function returns "Number" or "Letter", respectively.

Assuming we are testing a string in A2, the complete formula takes this shape:

=IF(ISNUMBER(VALUE(LEFT(A2, 1))), "Number", "Letter")

or

=IF(ISNUMBER(--LEFT(A2, 1)), "Number", "Letter")

IF ISNUMBER formula to check if the first character is number or letter

The ISNUMBER function also comes in handy for extracting numbers from a string. Here's an example: Get number from any position in a string.

Check if a value is not number

Though Microsoft Excel has a special function, ISNONTEXT, to determine whether a cell's value is not text, an analogous function for numbers is missing.

An easy solution is to use ISNUMBER in combination with NOT that returns the opposite of a logical value. In other words, when ISNUMBER returns TRUE, NOT converts it to FALSE, and the other way round.

To see it in action, please observe the results of the following formula:

=NOT(ISNUMBER(A2))

Checking if a value is not number

Another approach is using the IF and ISNUMBER functions together:

=IF(ISNUMBER(A2), "", "Not number")

If A2 is numeric, the formula returns nothing (an empty string). If A2 is not numeric, the formula says it upfront: "Not number".
IF ISNUMBER formula to check if a value is not number

If you'd like to perform some calculations with numbers, then put an equation or another formula in the value_if_true argument instead of an empty string. For example, the below formula will multiply numbers by 10 and yield "Not number" for non-numeric values:

=IF(ISNUMBER(A2), A2*10, "Not number")

Check if a range contains any number

In situation when you want to test the whole range for numbers, use the ISNUMBER function in combination with SUMPRODUCT like this:

SUMPRODUCT(--ISNUMBER(range))>0

SUMPRODUCT(ISNUMBER(range)*1)>0

For example, to find out if the range A2:A5 contains any numeric value, the formulas would go as follows:

=SUMPRODUCT(--ISNUMBER(A2:A5))>0

=SUMPRODUCT(ISNUMBER(A2:A5)*1)>0

Checking if a range contains any number

If you'd like to output "Yes" and "No" instead of TRUE and FALSE, utilize the IF statement as a "wrapper" for the above formulas. For example:

=IF(SUMPRODUCT(--ISNUMBER(A2:A5))>0, "Yes", "No")

Advanced formula to check if a range contains any number

How this formula works

At the heart of the formula, the ISNUMBER function evaluates each cell of the specified range, say B2:B5, and returns TRUE for numbers, FALSE for anything else. As the range contains 4 cells, the array has 4 elements:

{TRUE;FALSE;FALSE;FALSE}

The multiplication operation or the double unary (--) coerces TRUE and FALSE into 1's and 0's, respectively:

{1;0;0;0}

The SUMPRODUCT function adds up the elements of the array. If the result is greater than zero, that means there is at least one number the range. So, you use ">0" to get a final result of TRUE or FALSE.

ISNUMBER in conditional formatting to highlight cells that contain certain text

If you are looking to highlight cells or entire rows that contain specific text, create a conditional formatting rule based on the ISNUMBER SEARCH (case-insensitive) or ISNUMBER FIND (case-sensitive) formula.

For this example, we are going to highlight rows based on the value in column A. More precisely, we will highlight the items that contain the word "red". Here's how:

  1. Select all the data rows (A2:C6 in this example) or only the column in which you want to highlight cells.
  2. On the Home tab, in the Styles group, click New Rule > Use a formula to determine which cells to format.
  3. In the Format values where this formula is true box, enter the below formula (please notice that the column coordinate is locked with the $ sign):

    =ISNUMBER(SEARCH("red", $A2))

  4. Click the Format button and choose the format you want.
  5. Click OK twice.

If you have little experience with Excel conditional formatting, you can find the detailed steps with screenshots in this tutorial: How to create a formula-based conditional formatting rule.

As the result, all the items of the red color are highlighted:
Using ISNUMBER in conditional formatting to highlight cells that contain specific text

Instead of "hardcoding" the color in the conditional formatting rule, you can type it in a predefined cell, say E2, and refer to that cell in your formula (please mind the absolute cell reference $E$2). Additionally, you need to check if the input cell is not empty:

=AND(ISNUMBER(SEARCH($E$2, $A2)), $E$2<>"")

As the result, you will get a more flexible rule that highlights rows based on your input in E2:
Using ISNUMBER to highlight rows based on a cell value

That's how to use the ISNUMBER function in Excel. I thank you for reading and hope to see you on our blog next week!

Available downloads

Excel ISNUMBER formula examples

You may also be interested in:

Post a comment



Unfortunately, due to the volume of comments received we cannot guarantee that we will be able to give you a timely response. When posting a question, please be very clear and concise. We thank you for understanding!
60+ professional tools for Excel
60+ professional tools for Excel
2019–2007 to do your daily work
Incredible product, even better tech support…AbleBits totally delivers!
Deborah Bryant
Anyone who works with Excel is sure to find their work made easier
Jackie Lee
The best spent money on software I've ever spent!
Patrick Raugh
Ablebits is a fantastic product - easy to use and so efficient.
Debra Celmer
Excel is at its best now
Annie C.
I don't know how to thank you enough for your Excel add-ins
Jennifer Morningstar
Anybody who experiences it, is bound to love it!
Kumar Nepa
AbleBits suite has really helped me when I was in a crunch!
Nelda Fink
I have enjoyed every bit of it and time am using it
Christian Onyekachi Nwosu
It's the best $100 we've ever spent!
Mike Cavanagh
I love the program, and I can't imagine using Excel without it!
Robert Madsen
One word… WOW!
Dave Brown
Love the products!
David Johnston
It is like having an expert at my shoulder helping me…
Linda Shakespeare
Your software really helps make my job easier
Jeannie C.
Thanks for a terrific product that is worth every single cent!
Dianne Young
I love your product
Brad Gibson
Awesome!!!
Sheila Blanchard