To make Excel return one result when a cell contains a number and another when it does not, combine IF with ISNUMBER. With the value to test in A2, use =IF(ISNUMBER(A2),"Number","Not a number"). ISNUMBER performs the test; IF chooses which message to show.
How IF and ISNUMBER work together
ISNUMBER checks a value and returns the logical result TRUE or FALSE. IF takes a logical test and returns one value when the test is TRUE and another when it is FALSE. In the example above, a numeric value in A2 produces “Number”; anything ISNUMBER does not recognize as numeric produces “Not a number.”
For example, if A2 contains 42, the formula returns “Number.” If A2 contains the text word “forty-two,” it returns “Not a number.” The quoted phrases are labels chosen for the example; you can replace them with other text, numbers, or cell references. The basic syntax for IF is =IF(logical_test,value_if_true,value_if_false). The third argument is optional, but including it makes the result for a failed test explicit.
To see TRUE or FALSE instead of a message, you do not need IF at all. With the value to check in A2, enter =ISNUMBER(A2). This shorter test is useful in a helper column, in a filter condition, or as part of a larger formula.
What Excel counts as a number
ISNUMBER tests the value Excel stores, not just how the cell looks. Ordinary numeric values, including zero and negative numbers, return TRUE. Excel dates and times also return TRUE because Excel stores them as serial numbers: a date is represented by a number of days, and a time is represented by a fraction of a day. Applying a date or time number format changes how a value is displayed, not its underlying numeric status.
A number stored as text is different. If A2 contains the text “42” rather than the numeric value 42, ISNUMBER(A2) returns FALSE. This often happens after importing data from a text file, copying values from a website, or entering a number with a leading apostrophe. The cell may look like a number, but its stored type is text. Changing the number format alone does not convert text into a numeric value.
Other common results include:
- A blank cell is not a number, so ISNUMBER returns FALSE.
- A formula that returns a numeric result is recognized as numeric.
- A formula that returns text, including an empty string, is not numeric.
- TRUE and FALSE are logical values, not numbers for this test.
- An error value is not a number; use an error test as well if you need to distinguish errors from other nonnumeric values.
Use IF ISNUMBER in practical checks
A common use is to label data before reviewing or filtering it. With imported entries in A2:A100 and the check formula in B2, enter =IF(ISNUMBER(A2),"Valid number","Check entry"), then fill the formula down through B100. A numeric value is marked “Valid number”; text, blanks, and other nonnumeric entries are flagged for review. The formula does not change the original data.
You can also return a calculation only when its input is numeric. With a quantity in A2, use =IF(ISNUMBER(A2),A2*2,"Enter a number"). If A2 contains 7, the result is 14; if it contains the text “seven,” the formula displays the prompt instead of trying to use that text as a quantity.
For a blank cell, you may want a blank result rather than a warning. With the value in A2, use =IF(A2="","",IF(ISNUMBER(A2),"Number","Not a number")). This first checks whether A2 is blank or evaluates to an empty string, then tests the remaining value. Note that a cell containing zero is not blank: it proceeds to the number test and is labeled “Number.”
To count numeric cells in a range, COUNT is often simpler than writing a separate IF formula for every cell. With entries in A2:A100, use =COUNT(A2:A100). It returns the number of cells containing numeric values, including dates and times, while excluding text and blank cells.
When a number is stored as text
Decide first whether the text should truly be accepted as a number. If you only want to identify values Excel already stores numerically, use ISNUMBER by itself. If entries such as “42” should also count, you need to attempt a conversion. VALUE converts text that Excel recognizes as a number into a numeric value; the accepted format can depend on regional settings, especially for decimal and thousands separators.
With a possible number in A2, this formula labels blank entries separately and accepts text that VALUE can convert: =IF(A2="","Blank",IFERROR(IF(ISNUMBER(VALUE(A2)),"Number or numeric text","Not numeric"),"Not numeric")). A numeric 42 and text “42” both receive “Number or numeric text.” Text such as “blue” cannot be converted, so IFERROR returns “Not numeric.” The formula treats a cell that evaluates to an empty string as blank too.
Conversion is not always the right fix. A product code such as “00127” may look numeric but need to retain its leading zeros; converting it would change the kind of data it represents. Likewise, a long account identifier may be better stored as text. For data that should be numeric, conversion tools such as Text to Columns or multiplying by 1 can be appropriate, but check a copy of the data first and confirm that the resulting values are correct.
Common problems and misconceptions
A frequent source of confusion is assuming that visible appearance proves a cell is numeric. Alignment, symbols, and number formats can be misleading. A value with a currency symbol may be a real number formatted as currency, or it may be text copied from another source. ISNUMBER reports the underlying value, so it can help diagnose that difference.
Another mistake is testing whether a value is greater than zero when the real question is whether it is a number. A comparison such as A2>0 asks about magnitude, not data type; zero and negative numbers fail that condition even though both are numbers. ISNUMBER is the suitable test when the requirement is “is numeric,” regardless of sign.
Be careful with errors in the source cell. ISNUMBER is not a general error-handling formula. If the input contains an error, the outcome may need separate handling so an error does not propagate through a larger calculation. With a value in A2, one option is =IFERROR(IF(ISNUMBER(A2),"Number","Not a number"),"Source error"). This returns “Source error” if evaluating the test raises an error, while keeping the numeric and nonnumeric labels for ordinary values.
Also check the formula’s references when copying it. A2 is a relative reference, so filling the formula down changes it to A3, A4, and so on. If every row should test the same fixed cell, use an absolute reference such as $A$2. Excel uses commas between arguments in the formulas shown here; some regional configurations use different list separators, so a formula copied from another locale may need separator adjustment.
Choosing between ISNUMBER and related tests
Choose a function based on the question you need answered, not merely on the word “number.” ISNUMBER checks the stored type. COUNT counts numeric entries across a range. VALUE attempts to convert recognized numeric text. IFERROR handles calculation errors. These functions solve related but distinct problems, and combining them is useful when a worksheet must both classify and clean imported data.
- Use ISNUMBER when you need to know whether a cell already contains a numeric value.
- Use COUNT when you need the number of numeric cells in a range.
- Use VALUE when numeric-looking text needs conversion and Excel can interpret its format.
- Use IFERROR when a conversion or calculation might return an error that should be replaced with a controlled result.
For example, a date stored as a genuine Excel date passes ISNUMBER, but a date typed or imported as unconverted text does not. If your goal is to validate dates, numeric status alone is not enough: other numbers are also numeric, and a text date may need conversion and a more specific date check. The right test depends on what the column is meant to contain.
Frequently Asked Questions
Does ISNUMBER recognize a number stored as text?
No. ISNUMBER returns FALSE for numeric-looking text. Convert the value first if the worksheet should treat it as a number.
Does ISNUMBER return TRUE for dates?
Yes, for actual Excel dates and times. Excel stores them as numbers, even when a date or time format displays them differently.
How do I show blank instead of “Not a number”?
Test for a blank first, then run ISNUMBER. For a value in A2, the blank-aware formula above returns an empty string for a blank or empty-string result.
Can IF ISNUMBER check whether a cell contains a number above zero?
Yes. Combine ISNUMBER with a greater-than-zero condition. With the value in A2, use =IF(AND(ISNUMBER(A2),A2>0),"Positive number","Other"). This separates positive numeric values from zero, negatives, and nonnumeric entries.
Why does a cell look numeric but fail ISNUMBER?
It may be stored as text, often because it was imported or entered with a leading apostrophe. Check the cell’s value and convert it only if the data is meant to be numeric.
Related
- Excel File Too Large for No Reason? Find the Hidden Data
- Excel File Large for No Reason? Causes and Fixes to Try
- Excel Essential Keyboard Shortcuts for Everyday Work
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Microsoft 365 XLOOKUP Examples for Everyday Excel TasksIn Microsoft 365, XLOOKUP finds a value in one range and returns the corresponding value from another: use…
- Excel Function to Remove Text from a StringExcel does not have one universal “remove text” function: use SUBSTITUTE to remove specified characters or words, REPLACE…
- How to Get a Sequence Number in Excel AutomaticallyTo create a simple sequence number in Excel, enter a formula in the first numbering cell and fill…
- Excel Date Minus 1 Month? Formula and Date RulesTo subtract one calendar month from an Excel date, use =EDATE(A1,-1), where A1 contains a real Excel date.…
- Calculate Age in Excel with DATEDIF: Formula and TipsTo calculate someone’s age in completed years in Excel, enter their birth date in A2 and use =DATEDIF(A2,TODAY(),"Y").…
- Excel Formula for Dates Before Today: Flag, Filter, FormatWith dates in A2:A100, use =A2<TODAY() to test whether the date in A2 is before today; Excel returns…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.