How to Fix Excel Formula Treating N/A as Greater Than a Number
Question details
The user's greater-than formula returns unexpected results because the spreadsheet evaluates the text string "N/A" as being mathematically greater than numeric values.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Comparing two cells using logical operators (like greater-than) where one cell might contain placeholder text such as "N/A" instead of a number.
- Observed behavior
- The formula incorrectly evaluates the text "N/A" as greater than the number, returning an inaccurate TRUE or "Yes" result instead of recognizing the invalid data.
Check your dataset to confirm whether the cells contain the typed text string "N/A" or the actual #N/A calculation error, as this determines how the formula should be structured.
Use ISNUMBER and NA() to Validate Data Before Comparison
Prevent text from being evaluated as a number by explicitly checking if the cells contain numeric values, and return a true error if they do not.
In Excel's data hierarchy, any text string is considered greater than any number. By using the ISNUMBER function, you can force Excel to verify the data type before making the comparison.
Using the NA() function when the check fails is highly recommended for data analysis, as it generates a real #N/A error that prevents faulty data from being included in downstream calculations.
Click on the cell where you want the logical comparison result to appear.
Type the formula: =IF(OR(NOT(ISNUMBER(D13)),NOT(ISNUMBER(E13))),NA(),IF(E13>D13,"Yes","No")) into the formula bar. Replace D13 and E13 with your actual cell references.
Press Enter to execute the formula. If either cell contains text like "N/A", the cell will now display a #N/A error instead of a false "Yes".

Use AND with ISNUMBER for a Direct Yes/No Output
If you prefer the formula to output "No" rather than an error when encountering text, you can combine the AND function with ISNUMBER.
Easily Manage Formulas and Logical Comparisons in WPS Office
WPS Spreadsheet provides robust formula support, fully compatible with all standard Excel functions including ISNUMBER, IF, and NA(). You can seamlessly validate your data, perform complex logical comparisons, and audit your worksheets without any hassle.
- 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your data.
- 2. Select the formula cell: Click on the cell where you wish to perform the logical comparison.
- 3. Input the ISNUMBER formula: Type =IF(AND(ISNUMBER(E13),E13>D13),"Yes","No") into the formula bar and press Enter.
- 4. Apply across your dataset: Double-click the fill handle in the bottom right corner of the cell to instantly apply the formula to all corresponding rows.

Frequently Asked Questions
Why does Excel think text is greater than a number?
In Excel's underlying sorting and comparison logic, data types have a specific hierarchy. Any text string (including "N/A", letters, or symbols) is inherently evaluated as being greater than any numeric value. This is why a formula checking if "N/A" is greater than 100 will return TRUE.
What is the difference between typed "N/A" text and the #N/A error?
The text "N/A" is simply a string of characters manually typed into a cell by a user. The #N/A error is a designated system status meaning "value not available," typically generated automatically by lookup functions (like VLOOKUP) or the NA() function when data cannot be found.
Can I use the IFERROR function to fix this comparison issue?
No, the IFERROR function only catches actual calculation errors (like #DIV/0! or #VALUE!). Because Excel successfully evaluates text > number as a mathematically valid TRUE or FALSE statement, no system error is generated, and IFERROR will simply be bypassed.




