Calculation Issues

Sum Valid Excel Values and Exclude Errors or Invalid Rows

Olivia MillerOlivia Miller Dec 2, 2026 868 views

Question details

Calculate a total and percentage using valid rows while excluding invalid rows and error values.

Sum Valid Excel Values While Excluding Errors or Invalid Rows
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains status labels and values, and only valid rows should contribute to the total and percentage.
Observed behavior
The desired result is a total of valid, error-free values and a percentage based on an appropriate denominator.
Before you start

Identify the status and value columns, the label that marks a valid row, and the denominator for the percentage. The examples use status cells C2:C25, value cells D2:D25, the label "Valid Content", and a target in F2.

Solution 1Recommended

Use SUMPRODUCT to exclude invalid rows and errors

Use this method when either the status column or the value column may contain errors.

1
Calculate the valid total

Select an empty cell and enter =SUMPRODUCT(IFERROR((C2:C25="Valid Content")*D2:D25,0)). Replace the ranges and label with those in your worksheet.

2
Calculate the percentage

In another empty cell, enter =IFERROR(SUMPRODUCT(IFERROR((C2:C25="Valid Content")*D2:D25,0))/F2,""). Replace F2 with the cell containing your chosen denominator.

3
Format the result

Select the percentage cell and choose Home > Number > Percent Style in Excel.

Use SUMPRODUCT to exclude invalid rows and errors
Check the denominator: The percentage formula returns a blank if the denominator is zero or produces an error. Use a numeric, nonzero target or other appropriate denominator in F2.
Calculate valid totals in WPS Spreadsheets

Sum valid rows and calculate percentages in WPS Spreadsheets

Open your workbook in WPS Spreadsheets, use SUMPRODUCT with IFERROR to exclude invalid or error-containing rows, and divide the valid total by your chosen denominator.

  1. 1. Open the workbook: Open WPS Spreadsheets and choose Open to select your Excel workbook.
  2. 2. Enter the total formula: Select an empty cell and enter =SUMPRODUCT(IFERROR((C2:C25="Valid Content")*D2:D25,0)), adjusting the ranges and label as needed.
  3. 3. Calculate the percentage: In another cell, enter =IFERROR(SUMPRODUCT(IFERROR((C2:C25="Valid Content")*D2:D25,0))/F2,""); replace F2 with your denominator cell.
  4. 4. Format and save: Select the percentage cell, choose Percent Style on the Home tab, and save the workbook.
Exclude invalid statuses and error values from totalsOpen and edit Microsoft Excel XLSX and XLS filesCalculate and format percentages in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Does SUMIF ignore errors in matching value cells?

No. A matching error in the sum range can cause SUMIF to return an error. Use =SUMPRODUCT(IFERROR((C2:C25="Valid Content")*D2:D25,0)) to exclude those errors.

How do I exclude rows with an #N/A status?

Use =SUMPRODUCT(IFERROR((C2:C25="Valid Content")*D2:D25,0)). IFERROR converts errors in the status or value calculation to zero, so those rows do not contribute to the total.

What should I use as the percentage denominator?

Choose a denominator that matches your goal, such as a target value in F2. Divide the valid total by that cell and apply Percent Style; use a nonzero numeric value.

Why does the percentage formula return a blank?

In =IFERROR(E2/F2,""), a blank appears when the division produces an error, such as when F2 is zero. Check the denominator cell and the total in E2.