Excel SUMPRODUCT function: sum of products and array conditions
SUMPRODUCT totals price×quantity without a helper column, gives weighted averages and conditional sums with any logic you need. Plus the common traps.
SUMPRODUCT multiplies the matching items of several columns and adds up the results. The simplest case: price × quantity in each row, then everything summed — total revenue. No helper “Amount” column needed.
Its real power lies elsewhere, though. Inside SUMPRODUCT you can write conditions as arrays: “price × quantity for Tashkent”, “January sales”, “Tashkent or Samarkand”. SUMIFS can’t do much of this, while SUMPRODUCT works in every Excel version without Ctrl + Shift + Enter.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Qty | Amount | Measure | Value | |
| 2 | Rice | 18 000 | 25 | 450 000 | SUMPRODUCT | 1 970 000 | |
| 3 | Oil | 32 000 | 10 | 320 000 | Check | 1 970 000 | |
| 4 | Sugar | 13 500 | 40 | 540 000 | |||
| 5 | Flour | 7 800 | 50 | 390 000 | |||
| 6 | Tea | 45 000 | 6 | 270 000 | |||
| 7 |
Syntax
=СУММПРОИЗВ(array1; [array2]; [array3]; ...)
- array1 — the first range or array:
B2:B6. - array2, array3 … — more ranges (up to 255). Excel multiplies them row by row: B2×C2, B3×C3 … and adds the results.
Rules:
- All arrays must be the same size, otherwise #VALUE!.
- Text and blank cells in comma-separated arrays count as 0.
- With a single array, SUMPRODUCT behaves like plain SUM.
Step by step: entering SUMPRODUCT
1
Select F2 for the result.
2
Формулы → Математические → pick SUMPRODUCT.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Qty | Measure | Value | ||
| 2 | Rice | 18 000 | 25 | Revenue | |||
| 3 | Oil | 32 000 | 10 | ||||
| 4 | |||||||
| 5 |
3
Select the prices (B2:B6) for Array1 and the quantities (C2:C6) for Array2. Both ranges must start and end on the same rows. Click OK.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Qty | Measure | Value | ||
| 2 | Rice | 18 000 | 25 | Revenue | |||
| 3 | Oil | 32 000 | 10 | ||||
| 4 | |||||||
| 5 |
4
The result is 1,970,000. The formula: =СУММПРОИЗВ(B2:B6;C2:C6). Add a third array (say, a discount factor) and it joins the product too.
Example 1: a weighted average — GPA by credits
Plain AVERAGE treats every subject equally. But 6-credit math matters more than 2-credit history. A weighted average is the sum of “score × credits” divided by the sum of credits:
=СУММПРОИЗВ(B2:B6;C2:C6)/СУММ(C2:C6)
The same approach gives an average purchase price (price × volume / total volume), portfolio return and more.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Subject | Score | Credits | Measure | Value | ||
| 2 | Math | 92 | 6 | Weighted | 86,3 | ||
| 3 | Economics | 78 | 4 | Plain AVERAGE | 83,0 | ||
| 4 | English | 85 | 2 | ||||
| 5 | History | 65 | 2 | ||||
| 6 | Computer Science | 95 | 5 | ||||
| 7 |
Example 2: a conditional sum of products
You need Tashkent revenue, but the table only has price and quantity. SUMIFS can’t do it without a helper column. SUMPRODUCT accepts the condition as an array:
=СУММПРОИЗВ((A2:A7="Tashkent")*C2:C7*D2:D7)
How it works: A2:A7="Tashkent" gives TRUE or FALSE for each row. In multiplication TRUE = 1 and FALSE = 0, so rows from other cities are multiplied by 0 and drop out of the sum.
If you prefer commas, turn TRUE/FALSE into numbers with a double minus --: =СУММПРОИЗВ(--(A2:A7="Tashkent");C2:C7;D2:D7).
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | City | Product | Price | Qty | Written as | Result | |
| 2 | Tashkent | Rice | 18 000 | 25 | with * | 1 260 000 | |
| 3 | Samarkand | Oil | 32 000 | 10 | -- and commas | 1 260 000 | |
| 4 | Tashkent | Sugar | 13 500 | 40 | commas, no -- | 01 | |
| 5 | Bukhara | Flour | 7 800 | 50 | |||
| 6 | Tashkent | Tea | 45 000 | 6 | |||
| 7 | Samarkand | Rice | 18 000 | 15 | |||
| 8 |
Pro level: “or”, by month and case-sensitive
Inside SUMPRODUCT any function can serve as a condition, whereas SUMIFS only works with ready-made columns.
- “Or” — by adding.
=СУММПРОИЗВ(((A2:A7="Tashkent")+(A2:A7="Samarkand")>0)*C2:C7*D2:D7). The>0prevents double-counting a row that matches both conditions. - By month — no helper column.
=СУММПРОИЗВ((МЕСЯЦ(A2:A7)=1)*B2:B7)— January sales. To count them:=СУММПРОИЗВ(--(МЕСЯЦ(A2:A7)=1)). Careful: if the data spans several years, add aYEARcondition too. - Case-sensitive.
=СУММПРОИЗВ(--СОВПАД(B2:B9;"AB-1"))— COUNTIF would also count “ab-1”; this formula won’t. - In Microsoft 365. Thanks to dynamic arrays,
=СУММ((A2:A7="Tashkent")*C2:C7*D2:D7)works too. But SUMPRODUCT gives the same result in older versions — safer when the file goes to other people.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Date | Amount | Measure | Result | |||
| 2 | 03.01.2025 | 1 250 000 | January total | 3 990 000 | |||
| 3 | 14.01.2025 | 640 000 | February total | 3 120 000 | |||
| 4 | 29.01.2025 | 2 100 000 | January count | 3 | |||
| 5 | 04.02.2025 | 910 000 | |||||
| 6 | 12.02.2025 | 1 730 000 | |||||
| 7 | 24.02.2025 | 480 000 | |||||
| 8 |
Try it in the simulator
Type =СУММПРОИЗВ(B2:B6;C2:C6) in F2 to get total revenue. Then change the quantity in C3 to 20 — how much did the total grow?
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Product | Price | Qty | Measure | Value | |||||||||||||||||||
| 2 | Rice | 18000 | 25 | Revenue | ||||||||||||||||||||
| 3 | Oil | 32000 | 10 | |||||||||||||||||||||
| 4 | Sugar | 13500 | 40 | |||||||||||||||||||||
| 5 | Flour | 7800 | 50 | |||||||||||||||||||||
| 6 | Tea | 45000 | 6 | |||||||||||||||||||||
| 7 | ||||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.