The SUMPRODUCT function

Multiplies ranges row by row and adds the results. With a condition in parentheses it works as a flexible SUMIFS.

Syntax

SUMPRODUCT(array1, [array2], ...)
array1
The first range or array.
array2 (optional)
More ranges of the same size to multiply with.

Examples

E1=SUMPRODUCT(B2:B4,C2:C4)
ABCDE
1ItemQtyPrice450
2Pen410
3Book285
4Bag1240

In plain words: Multiply each quantity in B2:B4 by its price in C2:C4 and add up the results.

E1=SUMPRODUCT((B2:B4>1)*C2:C4)
ABCDE
1ItemQtyPrice95
2Pen410
3Book285
4Bag1240

Practice SUMPRODUCT

Read the guide

Related functions