Sum Absolute Values When an Adjacent Cell Equals Zero in Excel
Question details
Calculate the sum of absolute values in one column for rows where the corresponding adjacent cell equals zero.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Values are in one column, and an adjacent column determines which rows to include in the sum.
- Observed behavior
- The desired result is a total of the absolute values from rows whose corresponding adjacent cell equals zero.
Identify the value range and the adjacent condition range, and make sure they cover the same rows. The example uses values in A2:A70 and conditions in B2:B70.
Use SUMPRODUCT and ABS to sum qualifying values
Use this formula to add the absolute values in column A only where the corresponding cell in column B equals zero.
Click an empty cell outside the ranges A2:A70 and B2:B70.
Type =SUMPRODUCT(ABS(A2:A70)*(B2:B70=0)) in the cell or formula bar, then press Enter.
If your data is in different cells, edit both ranges in the formula bar so they start and end on corresponding rows.

Sum conditional absolute values in WPS Spreadsheet
Use SUMPRODUCT and ABS in WPS Spreadsheet to total absolute values only when the matching cell equals zero.
- 1. Open the workbook: Open WPS Spreadsheet and use File > Open to select your workbook.
- 2. Select a result cell: Click an empty cell outside your value and condition ranges.
- 3. Enter the formula: Type =SUMPRODUCT(ABS(A2:A70)*(B2:B70=0)) and press Enter. Replace the ranges with your own matching ranges if needed.
- 4. Save the workbook: Select File > Save to keep the formula in your workbook.

Frequently Asked Questions
How does the formula handle negative values?
ABS converts each value in A2:A70 to its absolute value before SUMPRODUCT adds the rows that meet the zero condition.
Can I exclude blank cells from the zero condition?
Yes. Use =SUMPRODUCT(ABS(A2:A70)*(B2:B70=0)*(B2:B70<>"")) to exclude blank cells in column B.
Why do the two ranges need to be the same size?
SUMPRODUCT compares and combines corresponding entries row by row. Use ranges such as A2:A70 and B2:B70 that cover the same number of rows.
Can I use a different condition instead of zero?
Yes. Edit the condition in the formula bar. For example, replace B2:B70=0 with B2:B70>0 to include rows where column B is positive.




