Sumif Ignore NA: How to Sum in Excel Without #N/A Errors
In this article
To make SUMIF ignore #N/A errors, put the criteria inside a comparison that excludes errors, or fix the errors at the source. If the sums are returning #N/A because some cells in the range contain errors, wrap the range in a function that hides them, or use SUMIFS with a criteria that filters them out. If you just want a clean total and do not need to preserve the errors, the most reliable route is to remove them with IFERROR at the source, then let plain SUMIF run on clean data.
There are two separate problems people mean by "sumif ignore na". The first is that the criteria column contains #N/A values that cause the sum to break. The second is that the sum range itself contains #N/A and the formula returns an error instead of a number. The fixes differ, so it helps to know which one you have before starting.
What You'll Need
- Excel 2016 or later, or Microsoft 365 (functions used here are standard and work in all current versions)
- A worksheet with a criteria column and a values column
- Basic familiarity with writing a formula and dragging it down
Step-by-Step
- Find out where the #N/A values sit. Click the column header of your criteria range and press Ctrl+F to search for
#N/A, or use Home > Find & Select > Find All. Write down whether the errors are in the criteria column, the values column, or both. This decides which fix below you need. Menu labels can differ slightly by Excel version and region. - Clean the source if you can. If the #N/A values come from lookup formulas, the best fix is at the source. Change the lookup from
=VLOOKUP(A2,Table,2,FALSE)to=IFERROR(VLOOKUP(A2,Table,2,FALSE),""). This turns errors into an empty string, which SUMIF treats as blank and ignores. Do this once in the first cell and drag the formula down the column. All your downstream SUMIF formulas then work without changes. - For errors in the values column, use SUMIFS with an error filter. Suppose criteria are in A2:A100 and values in B2:B100, and B contains some #N/A. Use:
=SUMIFS(B2:B100, A2:A100, "North", B2:B100, "<>#N/A")
The"<>#N/A"part tells Excel to include only values that are not the text #N/A. In many Excel versions this works because SUMIFS text comparisons skip error entries. If it still returns an error, the errors are genuine error values rather than text, and you need step 4. - For genuine error values, wrap the whole formula in IFERROR. The simplest guaranteed method is
=IFERROR(SUMIF(A2:A100, "North", B2:B100), 0). This keeps the result as a number and shows 0 when any error appears. The trade-off is that a real problem (like a broken reference) also gets hidden as 0, so use this only when you know the errors are the #N/A you are trying to skip, not a sign of something else. - Or aggregate only numeric values with SUMPRODUCT. If you need to sum only cells where both the criteria match and the value is a number (ignoring errors automatically), use:
=SUMPRODUCT((A2:A100="North")*IFERROR(B2:B100,0))
Enter it as a normal formula in current Excel. IFERROR converts each error to 0 inside the array, so the total stays clean. The one drawback is that SUMPRODUCT does not handle whole columns well; keep ranges tight, such as B2:B1000, rather than B:B. - If the criteria column has #N/A, filter it out. Use
=SUMIFS(B2:B100, A2:A100, "North", A2:A100, "<>#N/A")only if the #N/A are text. If they are real errors, the criteria check itself fails. In that case, add a helper column:=IFERROR(A2, ""), drag it down, then point your SUMIF at the helper column. This keeps your original data intact and lets the SUMIF run cleanly. - Test with a small range first. On a spare sheet, copy ten rows, add a deliberate #N/A, and check that each formula returns the expected number. Copy the formula that works back into your real sheet, then fill down or across.
Common Mistakes
- Confusing text #N/A with an error value. A cell that contains the literal text "#N/A" and a cell that contains a real error look almost identical. The
"<>#N/A"criteria only skip the text version. Click the cell and look at the formula bar: if the value appears there as text, it is text; if the cell shows #N/A and the formula bar shows=#N/Aor an error-producing formula, it is an error. - Wrapping the whole workbook in IFERROR. Doing this hides every problem, including broken references and wrong ranges, so bad totals look like valid zeros. Fix at the source where possible.
- Mismatched range sizes. SUMIFS requires every criteria range to be the same size as the sum range, or you get #VALUE! rather than a total.
- Forgetting that wildcards ignore errors. Criteria like
"*North*"still fail if the values column has errors, because the sum range is evaluated separately. - Deleting rows with errors without checking. Removing the row removes the data, so confirm the #N/A rows are genuinely unwanted before you delete anything.
Tips
- Convert your data to an Excel Table (Ctrl+T). Structured references make range sizes automatically consistent, which removes a whole class of #VALUE! errors.
- Keep a helper column like
=IFERROR(A2,"")and hide it rather than editing original data. You can always delete it later. - Use Conditional Formatting to colour #N/A cells so you can see how many exist and whether they should be fixed or ignored.
- For large sheets, ISNUMBER checks are useful:
=SUMIFS(B:B, A:A, "North", B:B, ">0")plus a separate count of negatives is often easier to audit than one clever formula. - Document the approach in a cell comment so the next person editing the workbook knows why the formula looks unusual.
Troubleshooting
The formula still returns #N/A. The errors are almost certainly real error values, not text. Wrap the SUMIF in IFERROR or switch to the SUMPRODUCT method above. If the errors are in the criteria range, move to a helper column first.
The total is wrong but not an error. Check that your criteria actually match. Text criteria are case-insensitive but must match exactly otherwise; use wildcards or TRIM to handle stray spaces. Also confirm that the sum range and criteria range line up row for row.
You get #VALUE! instead of a number. Range sizes differ between SUMIFS arguments. Select each range and compare the row counts, or convert to a Table to avoid the issue.
The result is 0 when you expect a number. That usually means every row was filtered out. Temporarily remove the "<>#N/A" criteria to test, then add it back. If the total changes, the criteria string is mismatching because of stray characters.
Nothing changed after you edited a formula. Check that calculation is set to Automatic under Formulas > Calculation Options. In manual mode, press F9 to recalculate.
The file is slow with SUMPRODUCT. Shrink the ranges. Whole-column references in array-style formulas force Excel to evaluate a million rows on every change.
Frequently Asked Questions
Does SUMIF ignore #N/A automatically?
No. SUMIF returns #N/A if the sum range contains error values. It ignores blanks and text in the sum range, but errors propagate.
What is the difference between #N/A as text and as an error?
Text #N/A is a string, and SUMIFS with "<>#N/A" can filter it out. A true #N/A error value comes from a broken lookup or reference and breaks the sum, so you need IFERROR or SUMPRODUCT.
Can I sum a column that has #N/A without changing the data?
Yes. Use =SUMPRODUCT((A2:A100="North")*IFERROR(B2:B100,0)) or wrap SUMIF in IFERROR. Both leave the original cells untouched.
Why does IFERROR give 0 instead of the real sum?
Because IFERROR catches the first error in the formula and returns the fallback for the entire result. If a real error exists anywhere in the range, you get 0. Test with a small range to confirm the formula itself is correct.
Will these methods work in Google Sheets?
SUMIF, SUMIFS, IFERROR and SUMPRODUCT behave the same way in Google Sheets, though syntax for optional arguments can be slightly more permissive. Use commas as separators in both.