Calculation Issues

Sum Absolute Values When an Adjacent Cell Equals Zero in Excel

Tauseeq MagsiTauseeq Magsi Dec 2, 2026 868 views

Question details

Calculate the sum of absolute values in one column for rows where the corresponding adjacent cell equals zero.

Sum Absolute Values When an Adjacent Cell Equals Zero in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select a result cell

Click an empty cell outside the ranges A2:A70 and B2:B70.

2
Enter the formula

Type =SUMPRODUCT(ABS(A2:A70)*(B2:B70=0)) in the cell or formula bar, then press Enter.

3
Adjust the ranges

If your data is in different cells, edit both ranges in the formula bar so they start and end on corresponding rows.

Use SUMPRODUCT and ABS to sum qualifying values
Check blank condition cells: The comparison can treat blank cells in column B as zero. To exclude blanks, use =SUMPRODUCT(ABS(A2:A70)*(B2:B70=0)*(B2:B70<>"")) instead.
Calculate in WPS Spreadsheet

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. 1. Open the workbook: Open WPS Spreadsheet and use File > Open to select your workbook.
  2. 2. Select a result cell: Click an empty cell outside your value and condition ranges.
  3. 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. 4. Save the workbook: Select File > Save to keep the formula in your workbook.
Sum absolute values with a zero condition in one formulaOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interfaceUse WPS Office for free
microsoft office alternative - wps office

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.