Formula Errors

How to Use Excel SUMIFS When the Sum Range Contains #N/A

Adam DavisAdam Davis Nov 22, 2026 869 views

Question details

The user wants to calculate a conditional sum without #N/A values in the sum range causing an error.

How to Use Excel SUMIFS When the Sum Range Contains #N/A
Product
Microsoft Excel
Device & OS
not provided
Scenario
Sum values on Sheet2 where the corresponding criteria cells match a value on Sheet1.
Observed behavior
SUMIFS can return #N/A when a matching cell in the sum range contains that error.
Before you start

Check that the sum range and criteria range cover the same number of rows. Identify the cell containing the matching value and the cells containing #N/A.

Solution 1Recommended

Exclude #N/A from the SUMIFS sum range

Add the sum range as a second criteria range to exclude #N/A values.

1
Select the result cell

Click the cell where you want the conditional total to appear.

2
Enter the SUMIFS formula

In the formula bar, enter =SUMIFS(Sheet2!$M$8:$M$156,Sheet2!$J$8:$J$156,Sheet1!D33,Sheet2!$M$8:$M$156,"<>#N/A") and press Enter.

3
Check the references

Replace the Sheet2 ranges and Sheet1!D33 with your own ranges and matching cell, then verify the total against the matching rows.

Exclude #N/A from the SUMIFS sum range
Other errors: This criterion targets #N/A. If other errors affect the result, use the SUMPRODUCT approach below to treat errors in the sum range as zero.
Work with formulas in WPS Spreadsheets

Calculate error-safe conditional sums in WPS Spreadsheets

Use SUMPRODUCT and IFERROR in WPS Spreadsheets to total matching values while treating errors in the sum range as zero.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select the result cell: Click the cell where you want to display the conditional total.
  3. 3. Enter the formula: Enter =SUMPRODUCT(IFERROR(Sheet2!$M$8:$M$156,0),IFERROR(--(Sheet2!$J$8:$J$156=Sheet1!D33),0)) in the formula bar and press Enter.
  4. 4. Adapt the references: Edit the Sheet2 ranges and Sheet1!D33 to match your workbook, then check the result against the matching rows.
Calculate conditional totals without #N/A values interrupting the resultOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and worksheets
microsoft office alternative - wps office

Frequently Asked Questions

Why does SUMIFS return #N/A?

A matching cell in the sum range may contain #N/A. Add the sum range as a criteria range with "<>#N/A", or use SUMPRODUCT with IFERROR to treat errors as zero.

Can I ignore errors other than #N/A?

Yes. Use IFERROR around the sum range in a SUMPRODUCT formula to replace errors such as #N/A and #DIV/0! with zero for the calculation.

Do the SUMIFS ranges need to be the same size?

Yes. In the example, both Sheet2!M8:M156 and Sheet2!J8:J156 cover the same rows. Adjust both ranges together when changing the formula.

What happens if a matching criteria cell contains an error?

The SUMPRODUCT alternative uses IFERROR around the comparison, so an error in a criteria cell is treated as a nonmatch.