FormulaCraft

SUM vs SUMPRODUCT for conditional totals

Topic:SUM & aggregation
Excel & Google Sheets
=SUMPRODUCT((A2:A6="Alice")*(B2:B6))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1For a simple total, use =SUM(B2:B6). For a conditional total, use =SUMIF(A2:A6,"Alice",B2:B6).
  2. 2For multiple conditions, use =SUMIFS(B2:B6, A2:A6,"Alice", C2:C6,"Active") — SUMIFS is cleaner for up to about three conditions.
  3. 3For complex or computed conditions, use SUMPRODUCT: =SUMPRODUCT((A2:A6="Alice")*(B2:B6)) — each condition in parentheses returns a 1/0 array that acts as a filter.
  4. 4Combine multiple conditions: =SUMPRODUCT((A2:A6="Alice")*(B2:B6>100)*(B2:B6)) sums column B where A is Alice AND B is over 100.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

Can SUMPRODUCT replace SUMIFS entirely?

SUMPRODUCT can replicate all SUMIFS behaviour and more, but SUMIFS is faster on large ranges and more readable for simple criteria. Use each where it fits best.

Why does SUMPRODUCT return 0 instead of the expected total?

The most common cause is a text-stored number in the sum column. Multiply by 1 inside the formula (B2:B6*1) to coerce text numbers to values.

More on SUM & aggregation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: