SUMPRODUCT
SOMPRODUCT in Dutch Excel
Multiplies the matching items of two or more ranges and adds up the products, which also makes it a tool for conditional sums and weighted averages.
Last updated: 13 October 2026
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Article | Quantity | Cost price | Inventory value | |
| 2 | Copper pipe 15 mm | 240240 | €4.85€ 4,85 | €9,739.50€ 9.739,50=SUMPRODUCT(B2:B5, C2:C5)=SUMPRODUCT(B2:B5; C2:C5) | |
| 3 | Boiler 80 L | 1212 | €389.00€ 389,00 | ||
| 4 | Radiator valve | 150150 | €12.40€ 12,40 | ||
| 5 | Thermostat | 3535 | €58.50€ 58,50 |
Swipe sideways to see all columns
Result: €9,739.50€ 9.739,50
=SUMPRODUCT(B2:B5,C2:C5)
=SUMPRODUCT(B2:B5;C2:C5)
What SUMPRODUCT does and when to use it
What it does: it multiplies matching items from two or more ranges and adds the products, for example quantity times cost price over a stock list.
When to use it: for totals that need a multiplication per row, weighted averages and conditional sums SUMIFS cannot express (OR between criteria, calculated conditions, case-sensitive matches). For plain AND conditions, SUMIFS is faster.
Three main gains:
- No helper column: multiply inside the formula instead of adding a column of products first.
- Conditions SUMIFS cannot do: OR, calculated values and case-sensitive matches with EXACT.
- No array entry: works in every Excel version without Ctrl+Shift+Enter.
How Excel evaluates it
Excel works through four steps:
- it evaluates every argument into an array: a range is read as its values, and an expression such as (A2:A7=E2) is calculated for each row
- it checks that all arrays have the same number of rows and columns, and returns #VALUE! if they do not
- it multiplies position 1 of every array, position 2 of every array, and so on; items that are text, blank or TRUE/FALSE count as 0 at this point
- it adds all those products into one number
Because TRUE and FALSE count as 0 here, a condition array needs -- or a multiplication to become 1s and 0s before it does any work.
Watch out: A comparison such as (A2:A7=E2) in a separate argument gives TRUE and FALSE, which SUMPRODUCT counts as 0, so the result is 0 although several rows match. Convert it with a double minus, --(A2:A7=E2), or multiply: (A2:A7=E2)*B2:B7.
Mental model
A till receipt: each line is quantity times price, and the bottom line adds the lines up. A condition is a column of 1s and 0s that switches lines on or off before the adding starts.
SUMPRODUCT(array1,[array2], ...)
SUMPRODUCT(array1;[array2]; ...)
| Argument | Type | Meaning |
|---|---|---|
array1 | Required | The first range or array; every other array must have the same size. |
array2 | Optional | More arrays, multiplied position by position with array1. |
Return value:One number: the sum of the item-by-item products
Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).
Worked examples
Beginner
Inventory value from quantities and cost prices
You are auditing Veldhuis Installatie BV. The inventory list (voorraadlijst) at 31 December 2025 shows a quantity and a cost price per article, and the ledger shows account 3000 Voorraad at 9,800.009.800,00. You want the value of the list in one cell, without adding a helper column of line values first, so you can explain the difference.
| Row | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Article | Quantity | Cost price | Inventory value | ||
| 2 | Copper pipe 15 mm | 240240 | €4.85€ 4,85 | €9,739.50€ 9.739,50=SUMPRODUCT(B2:B5, C2:C5)=SUMPRODUCT(B2:B5; C2:C5) | ||
| 3 | Boiler 80 L | 1212 | €389.00€ 389,00 | |||
| 4 | Radiator valve | 150150 | €12.40€ 12,40 | |||
| 5 | Thermostat | 3535 | €58.50€ 58,50 | |||
| 6 |
Swipe sideways to see all columns
Formula in E2
=SUMPRODUCT(B2:B5,C2:C5)
=SUMPRODUCT(B2:B5;C2:C5)
Result: €9,739.50€ 9.739,50
Step by step
- Excel reads array1,
B2:B5, as the four quantities 240, 12, 150 and 35, and array2,C2:C5, as the four cost prices 4.85, 389, 12.4 and 58.5. Both are 4 rows by 1 column, so the sizes match. - It multiplies the first items: 240 × 4.85 = 1,1641.164. Then the second: 12 × 389 = 4,6684.668.
- Then the third and fourth: 150 × 12.4 = 1,8601.860 and 35 × 58.5 = 2,047.52.047,5.
- It adds the four products: 1,1641.164 + 4,6684.668 + 1,8601.860 + 2,047.52.047,5 = 9,739.59.739,5. That single number is the result in
E2. - Compare with the ledger: 9,800.009.800,00 - 9,739.509.739,50 = 60.50. That is the difference you ask the client to explain.
Watch out: Select C2:C6 by accident and the ranges no longer match: the result is #VALUE!, not a wrong total. That error is SUMPRODUCT's size check doing its job.
More on this example: why it works, 1 variation
Why it works
The two ranges are linked only by position: the first quantity belongs to the first cost price because they sit in the same row. SUMPRODUCT does the per-row multiplication that a helper column would do, and the sum that a SUM over that column would do, in one step.
Variations
=SUM(B2:B5 * C2:C5)
=SUM(B2:B5 * C2:C5)
The same total in Excel 2021 or Microsoft 365, where SUM handles the array multiplication itself. In Excel 2019 and earlier it needs Ctrl+Shift+Enter; SUMPRODUCT never does.
Intermediate
Recalculated VAT per journal, with a dash as VAT rate
You recalculate the VAT (btw) on the sales and purchase journals of an XAF export: a net amount and the VAT rate of each line. You want the recalculated VAT per journal next to a short list of journal codes, with one formula copied down, and compare it with the VAT return (btw-aangifte).
One line without a VAT code has a hyphen in the rate column, and that must not break the total.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Journal | Net amount | VAT rate | Journal | Recalculated VAT | ||
| 2 | VRK | €1,000.00€ 1.000,00 | 21%21% | VRK | €282.00€ 282,00=SUMPRODUCT(--($A$2:$A$7 = E2), $B$2:$B$7, $C$2:$C$7)=SUMPRODUCT(--($A$2:$A$7 = E2); $B$2:$B$7; $C$2:$C$7) | ||
| 3 | INK | €2,400.00€ 2.400,00 | 21%21% | INK | |||
| 4 | VRK | €500.00€ 500,00 | - | ||||
| 5 | VRK | €800.00€ 800,00 | 9%9% | ||||
| 6 | INK | €300.00€ 300,00 | 9%9% | ||||
| 7 | INK | €1,500.00€ 1.500,00 | 21%21% | ||||
| 8 |
Swipe sideways to see all columns
Formula in F2
=SUMPRODUCT(--($A$2:$A$7 = E2),$B$2:$B$7, $C$2:$C$7)
=SUMPRODUCT(--($A$2:$A$7 = E2);$B$2:$B$7; $C$2:$C$7)
Result: €282.00€ 282,00
Step by step
- Excel evaluates the comparison first: each cell of
$A$2:$A$7againstE2(VRK). That gives TRUE, FALSE, TRUE, TRUE, FALSE, FALSE. - The double minus turns TRUE into 1 and FALSE into 0: {1; 0; 1; 1; 0; 0}. Without it, SUMPRODUCT would count every TRUE as 0 and return 0 for every journal.
- It multiplies three arrays position by position. Row 2: 1 × 1,0001.000 × 0.21 = 210. Rows 3, 6 and 7 have a 0 in the first array, so they give 0 whatever their amount is.
- Row 4 is VRK, but its VAT rate is the text
-. Because the rates are a separate argument, SUMPRODUCT counts that text as 0: 1 × 500 × 0 = 0. Row 5: 1 × 800 × 0.09 = 72. - The products add up to 210 + 0 + 72 = 282, the recalculated VAT on the sales journal in
F2. - Copy
F2toF3. The $ signs keep the three data ranges fixed and onlyE2moves toE3(INK): 2,4002.400 × 0.21 + 300 × 0.09 + 1,5001.500 × 0.21 = 504 + 27 + 315 = 846.
Watch out: Treating text as 0 also means that a VAT rate imported as text, '0.21 with an apostrophe, silently drops out of the recalculation. If the recalculated VAT looks low, check the rate column with ISNUMBER.
More on this example: why it works, 1 more pitfall, 1 variation
Why it works
The condition becomes a column of 1s and 0s that switches whole rows on or off before the multiplication. Keeping amounts and rates as separate arguments, rather than multiplying them with *, is what makes the hyphen harmless: in the comma form SUMPRODUCT treats text as 0, while 500 * "-" inside the formula would be #VALUE!.
More to watch out for
- Write the formula as SUMPRODUCT(($A$2:$A$7 = E2) * $B$2:$B$7 * $C$2:$C$7) and the hyphen produces #VALUE! for every journal, because the multiplication happens before SUMPRODUCT can skip the text.
Variations
=SUMPRODUCT(($A$2:$A$7 = E2) * 1,$B$2:$B$7, $C$2:$C$7)
=SUMPRODUCT(($A$2:$A$7 = E2) * 1;$B$2:$B$7; $C$2:$C$7)
Multiplying by 1 converts TRUE and FALSE to 1 and 0, the same way the double minus (--) does. Use whichever form your colleagues read best; the result is the same 282.
Advanced
Revenue postings from manual or bank journals
In journal entry testing you want the total of postings on account 8000 Omzet that come from the manual (MEM) or bank (BNK) journal, because revenue normally comes from the sales journal VRK.
SUMIFS combines its criteria with AND only, so 'MEM or BNK, and account 8000' needs either two SUMIFS added up or one SUMPRODUCT that adds the two journal tests. The journals and the account sit in input cells so you can change them.
| Row | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| 1 | Entry no. | Journal | Account | Amount | Journal 1 | MEM | ||
| 2 | 25-0401 | VRK | 80008000 | €12,500.00€ 12.500,00 | Journal 2 | BNK | ||
| 3 | 25-0402 | MEM | 80008000 | €4,800.00€ 4.800,00 | Account | €8,000.00€ 8.000,00 | ||
| 4 | 25-0403 | BNK | 11001100 | €3,200.00€ 3.200,00 | Total | €8,800.00€ 8.800,00=SUMPRODUCT(((B2:B8 = G1) + (B2:B8 = G2)) * (C2:C8 = G3), D2:D8)=SUMPRODUCT(((B2:B8 = G1) + (B2:B8 = G2)) * (C2:C8 = G3); D2:D8) | ||
| 5 | 25-0404 | MEM | 45004500 | €950.00€ 950,00 | ||||
| 6 | 25-0405 | BNK | 80008000 | €1,750.00€ 1.750,00 | ||||
| 7 | 25-0406 | VRK | 80008000 | €9,300.00€ 9.300,00 | ||||
| 8 | 25-0407 | MEM | 80008000 | €2,250.00€ 2.250,00 | ||||
| 9 |
Swipe sideways to see all columns
Formula in G4
=SUMPRODUCT(((B2:B8 = G1) + (B2:B8 = G2)) * (C2:C8 = G3),D2:D8)
=SUMPRODUCT(((B2:B8 = G1) + (B2:B8 = G2)) * (C2:C8 = G3);D2:D8)
Result: €8,800.00€ 8.800,00
Step by step
- Excel evaluates the innermost tests first. (B2:B8 = G1) checks each journal against MEM: {0; 1; 0; 1; 0; 0; 1} once the arithmetic turns TRUE into 1. (B2:B8 = G2) checks against BNK: {0; 0; 1; 0; 1; 0; 0}.
- The + adds the two arrays position by position: {0; 1; 1; 1; 1; 0; 1}. Adding is the OR: a row counts if it is MEM or BNK. A row cannot be both, so no position exceeds 1.
- (C2:C8 = G3) checks the account against 8000: {1; 1; 0; 0; 1; 1; 1}. The * multiplies it with the OR array: {0; 1; 0; 0; 1; 0; 1}. Multiplying is the AND: both must be 1.
- SUMPRODUCT now multiplies that array with
D2:D8and adds: 1 × 4,8004.800 + 1 × 1,7501.750 + 1 × 2,2502.250 = 8,8008.800. Entry25-0403(BNK, account 1100) and25-0404(MEM, account 4500) were switched off by the account test. - Change
G3to 4500 and the result becomes 950: the same OR, a different AND.
Watch out: Type MEM in G2 as well and the two tests overlap: MEM rows get 1 + 1 = 2, and the result silently becomes 2 × 7,0507.050 = 14,10014.100 instead of 7,0507.050. Wrap the OR part in ((...) > 0) whenever the terms can both be true, for example when they test different columns.
More on this example: why it works, 1 more pitfall, 2 variations
Why it works
In arithmetic, TRUE is 1 and FALSE is 0, so + behaves as OR and * as AND, as long as the OR terms cannot both be true for one row. The finished array of 1s and 0s is a mask: SUMPRODUCT multiplies it with the amounts and adds only the rows the mask lets through.
More to watch out for
- If a journal code was exported as 'MEM ' with a trailing space, = finds no match and that posting drops out without any error. TRIM on the column removes the space.
Variations
=SUMIFS(D2:D8,B2:B8, G1, C2:C8, G3) + SUMIFS(D2:D8, B2:B8, G2, C2:C8, G3)
=SUMIFS(D2:D8;B2:B8; G1; C2:C8; G3) + SUMIFS(D2:D8; B2:B8; G2; C2:C8; G3)
Two SUMIFS, one per journal, added: 7,0507.050 + 1,7501.750 = 8,8008.800. Faster on large tables and readable for anyone who knows SUMIFS, but every extra OR value means another SUMIFS.
=SUMPRODUCT((((B2:B8 = G1) + (B2:B8 = G2)) > 0) * (C2:C8 = G3),D2:D8)
=SUMPRODUCT((((B2:B8 = G1) + (B2:B8 = G2)) > 0) * (C2:C8 = G3);D2:D8)
The safe OR: > 0 turns any count of matches into 1, so overlapping conditions cannot double a row.
MasterExcel 2021 or later (This example needs Excel 2021 or later)
Weighted days to pay that skips open invoices
From the receivables list (debiteurenlijst) you want the average number of days a customer takes to pay, weighted by invoice amount so a large invoice counts more than a small one.
Invoices that are still open have no payment date yet, so their blank days must not count as 0, and a customer with no paid invoices must show a message instead of #DIV/0!. The formula uses LET so each step has a name.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Relation | Invoice amount | Days to pay | Relation | D1001 | ||
| 2 | D1001 | €12,000.00€ 12.000,00 | 3030 | Weighted days | 43.8343,83=LET( keep, (A2:A8 = F1) * ISNUMBER(C2:C8), weights, keep * B2:B8, points, SUMPRODUCT(weights, C2:C8), IF(SUM(weights) = 0, "No paid invoices", points / SUM(weights)) )=LET( keep; (A2:A8 = F1) * ISNUMBER(C2:C8); weights; keep * B2:B8; points; SUMPRODUCT(weights; C2:C8); IF(SUM(weights) = 0; "No paid invoices"; points / SUM(weights)) ) | ||
| 3 | D1002 | €8,000.00€ 8.000,00 | 4545 | ||||
| 4 | D1001 | €3,000.00€ 3.000,00 | |||||
| 5 | D1001 | €25,000.00€ 25.000,00 | 6060 | ||||
| 6 | D1002 | €15,000.00€ 15.000,00 | 3838 | ||||
| 7 | D1001 | €10,000.00€ 10.000,00 | 2020 | ||||
| 8 | D1003 | €6,000.00€ 6.000,00 | 9090 | ||||
| 9 |
Swipe sideways to see all columns
Formula in F2
=LET( keep,(A2:A8 = F1) * ISNUMBER(C2:C8), weights, keep * B2:B8, points, SUMPRODUCT(weights, C2:C8), IF(SUM(weights) = 0, "No paid invoices", points / SUM(weights)) )
=LET( keep;(A2:A8 = F1) * ISNUMBER(C2:C8); weights; keep * B2:B8; points; SUMPRODUCT(weights; C2:C8); IF(SUM(weights) = 0; "No paid invoices"; points / SUM(weights)) )
Result: 43.8343,83
Step by step
- keep compares
A2:A8withF1(D1001), {1; 0; 1; 1; 0; 1; 0}, and multiplies by ISNUMBER(C2:C8), which is FALSE only for the blank inC4: {1; 1; 0; 1; 1; 1; 1}. The product is {1; 0; 0; 1; 0; 1; 0}: D1001 invoices that have been paid. - weights multiplies keep by the invoice amounts: {12000; 0; 0; 25000; 0; 10000; 0}. The open invoice of 3,0003.000 is now weight 0, as are the other customers.
- points is SUMPRODUCT(weights, C2:C8): 12,00012.000 × 30 + 25,00025.000 × 60 + 10,00010.000 × 20 = 360,000360.000 + 1,500,0001.500.000 + 200,000200.000 = 2,060,0002.060.000. The blank in
C4meets a weight of 0, so it adds nothing either way. - SUM(weights) is 12,00012.000 + 25,00025.000 + 10,00010.000 = 47,00047.000, not 0, so IF takes the calculation: 2,060,0002.060.000 / 47,00047.000 = 43.8297..., shown as 43.83 days.
- Without ISNUMBER in keep, the 3,0003.000 invoice would stay in the weights while adding 0 points: 2,060,0002.060.000 / 50,00050.000 = 41.2. A plausible figure, silently 2.63 days too low, because an open invoice would count as paid on day 0.
- Type D1009 in
F1. No row matches, SUM(weights) is 0, and IF returns No paid invoices instead of dividing by zero. Type D1002 and the result is (8,0008.000 × 45 + 15,00015.000 × 38) / 23,00023.000 = 930,000930.000 / 23,00023.000 = 40.43.
Watch out: The mirror-image mistake is the unweighted average: SUMPRODUCT(keep, C2:C8) / SUM(keep) gives (30 + 60 + 20) / 3 = 36.67. It also uses the right rows and looks equally reasonable, but an invoice of 10,00010.000 and one of 25,00025.000 now count the same.
More on this example: why it works, 1 more pitfall, 1 variation
Why it works
A weighted average is sum(weight × value) / sum(weight), and both sums must use the same rows. Building one weights array and using it in the numerator and the denominator guarantees that; an open invoice leaves both, instead of leaving only the top. LET calculates weights once and names it, so the guard and the division read the same thing.
Do not use this construction on a ledger extract with hundreds of thousands of rows that recalculates often: every SUMPRODUCT walks every row.
The alternative is a helper column with invoice amount × days and two SUMIFS (points over weights) with a criterion "<>" on the days column; faster, at the cost of an extra column.
More to watch out for
- A number of days typed as text, '30 with an apostrophe, fails ISNUMBER and is skipped like an open invoice. That is safer than counting it as 0, but the figure is then based on fewer invoices than you think.
Variations
=SUMPRODUCT((A2:A8 = F1) * ISNUMBER(C2:C8),B2:B8, C2:C8) / SUMPRODUCT((A2:A8 = F1) * ISNUMBER(C2:C8), B2:B8)
=SUMPRODUCT((A2:A8 = F1) * ISNUMBER(C2:C8);B2:B8; C2:C8) / SUMPRODUCT((A2:A8 = F1) * ISNUMBER(C2:C8); B2:B8)
The same 43.83 without LET, for Excel versions before 2021. The condition is written twice, which is where copies of this formula usually go out of step.
Common mistakes
| Symptom | Cause | Fix |
|---|---|---|
| #VALUE! when the ranges differ in size | The result is #VALUE! after you extended one range to row 8 and left the other at row 7. | Every array must be exactly the same size. Select the same rows in each argument, or convert the data to a Table so the ranges grow together. |
| AB-12 counted although you typed ab-12 | You count codes with SUMPRODUCT(--(A2:A9="ab-12")) and AB-12 is counted as well. | The = comparison ignores case. For a case-sensitive count use SUMPRODUCT(--EXACT(A2:A9, "ab-12")); EXACT compares letter for letter, including case. |
| Workbook slow with whole columns | A workbook with SUMPRODUCT over whole columns (A:A, B:B) has become slow. | SUMPRODUCT really multiplies every row you give it, a million rows per column. Limit the ranges to the data, or use a Table, or switch to SUMIFS when the conditions allow it. |
Used in combinations
- Debtor age analysis table that ties to the control accountTotal the open amount per age band with one SUMIFS over a band table, add the bands up with SUM and check that the total agrees with the control account.
- Year-end cut-off test with FILTER and SUMFlag the sales invoices whose booking date and delivery date fall on different sides of year end and total them: two comparisons with the year-end date give TRUE or FALSE per date, FILTER keeps the invoices where the two differ, and SUM adds them up.Excel 2021 or later (This combination needs Excel 2021 or later)
- Differences above the reporting threshold with LET, FILTER, HSTACK and ABSReconcile the ledger to the client's specification per customer and list only the differences above the reporting threshold: LET names the differences once, HSTACK pairs them with the customer, FILTER keeps the rows where ABS exceeds the threshold.Excel 2024 or later (This combination needs Excel 2024 or later)
- Receivables aging total per 30-day bandTurn every due date into a band with XLOOKUP and match_mode -1 on a band table, then let SUM add up the open amounts of one band.Excel 2021 or later (This combination needs Excel 2021 or later)
- Round-sum journal entries with FILTER, MOD, ROUND and ABSFlag ledger lines whose amount is an exact multiple of 1,000 (and above a minimum): ABS removes the sign, ROUND clears floating-point noise, MOD tests the multiple and FILTER lists the lines.Excel 2021 or later (This combination needs Excel 2021 or later)