Formula Errors

WPS Spreadsheet Formula to Handle #N/A and Specific Numeric Values

Phi Hung VoPhi Hung Vo Nov 12, 2026 869 views

Question details

The user needs a formula that detects #N/A in either cell, safely checks whether the other cell equals 2 or 3, and returns different results for valid, double-error, and other combinations.

Product
WPS Spreadsheet
Device & OS
not provided
Scenario
A worksheet compares two cells that may contain #N/A, 2, 3, or other values. The goal is to avoid comparison errors while returning 10 for the specified combinations.
Observed behavior
Direct comparisons such as A1=2 or B1=3 can produce another error when the referenced cell contains #N/A. The desired results are 10 for either valid combination, #N/A when both cells contain #N/A, and ERROR for all other combinations.
Before you start

Confirm that the values to test are in A1 and B1, or replace those references with the correct cell addresses. Check that the cells use the actual #N/A error value rather than text such as "#N/A".

Solution 1Recommended

Use ISNA and IFERROR to classify #N/A and numeric values

Use this formula when either cell can contain #N/A and comparisons against 2 or 3 must not create additional errors.

ISNA identifies an actual #N/A value, while IFERROR converts failed comparisons into FALSE. This lets the formula test numeric values safely before applying the required result logic.

1
Select the result cell

Open the worksheet in WPS Spreadsheet and select the cell where the result should appear.

2
Enter the error-safe formula

Enter =IF(AND(ISNA(A1),OR(IFERROR(B1=2,FALSE),IFERROR(B1=3,FALSE))),10,IF(AND(ISNA(B1),OR(IFERROR(A1=2,FALSE),IFERROR(A1=3,FALSE))),10,IF(AND(ISNA(A1),ISNA(B1)),NA(),"ERROR"))) in the formula bar, then press Enter.

3
Adjust the cell references

Replace A1 and B1 with the two cells you need to evaluate, keeping the ISNA and IFERROR functions in the same positions.

4
Verify each result

Test the formula with one #N/A and a 2 or 3, two #N/A values, and other combinations to confirm that it returns 10, #N/A, or ERROR as intended.

Expected results: The formula returns 10 when one cell is #N/A and the other is 2 or 3, #N/A when both cells contain #N/A, and ERROR for all other combinations.

Handle #N/A comparisons safely in WPS Spreadsheet

WPS Spreadsheet supports ISNA, IFERROR, AND, OR, and IF, so you can build an error-safe formula that evaluates #N/A and numeric values without triggering unwanted comparison errors.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open the workbook containing the cells you want to test.
  2. 2. Select the output cell: Click the cell where the classification result should be displayed.
  3. 3. Enter the formula: Paste the ISNA and IFERROR formula into the formula bar, update A1 and B1 if needed, and press Enter.
  4. 4. Check the output: Test the relevant combinations to confirm that the formula returns 10, #N/A, or ERROR correctly.
Safely compare cells that may contain #N/AReturn custom results for values 2 and 3 or other combinationsUse familiar Excel-style functions and formulasOpen and save Microsoft Excel .xlsx files with format compatibility
microsoft office alternative - wps office

Frequently Asked Questions

Why does a comparison such as A1=2 return an error?

If A1 contains the #N/A error value, a direct comparison such as A1=2 also returns an error. Wrap the comparison in IFERROR(A1=2,FALSE) to convert that failed comparison into FALSE.

What does the formula return when both cells contain #N/A?

The final IF branch uses IF(AND(ISNA(A1),ISNA(B1)),NA(),"ERROR"), so the result is the #N/A error value when both cells contain #N/A.

How can I return 10 when only one cell is #N/A and the other is 2 or 3?

Use the full formula with ISNA on one cell and IFERROR-wrapped comparisons on the other. It checks both directions, so either A1 or B1 can contain #N/A.

Can I use different numeric values instead of 2 and 3?

Yes. Replace the comparison values in IFERROR(B1=2,FALSE) and IFERROR(B1=3,FALSE), along with the corresponding A1 comparisons, with the values you need.

Can this formula be used in Microsoft Excel files?

Yes. WPS Spreadsheet supports these standard Excel functions and can open and save compatible .xlsx workbooks, although regional settings may require commas or semicolons as formula separators.