Available in:All versions (Works in Excel 2007, every later version, Microsoft 365 and Excel for the web)Examples need Excel 2021 or laterCategory:Math

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.

Difficulty rating 4 of 5. The function itself only multiplies and adds; the skill is thinking in arrays, turning conditions into 1s and 0s and keeping every array the same size.

Last updated: 13 October 2026

See the worked examples

Sheet excerpt: E2 holds the formula
RowABCDE
1ArticleQuantityCost priceInventory value
2Copper pipe 15 mm240240€4.85€ 4,85€9,739.50€ 9.739,50=SUMPRODUCT(B2:B5, C2:C5)=SUMPRODUCT(B2:B5; C2:C5)
3Boiler 80 L1212€389.00€ 389,00
4Radiator valve150150€12.40€ 12,40
5Thermostat3535€58.50€ 58,50
Formula cell (E2)Input

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.

Terms used on this page: criteria, array, argument, range

SUMPRODUCT(array1, [array2], ...)
SUMPRODUCT(array1; [array2]; ...)
Arguments
ArgumentTypeMeaning
array1RequiredThe first range or array; every other array must have the same size.
array2OptionalMore 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.

Sheet excerpt: E2 holds the formula
RowABCDEF
1ArticleQuantityCost priceInventory value
2Copper pipe 15 mm240240€4.85€ 4,85€9,739.50€ 9.739,50=SUMPRODUCT(B2:B5, C2:C5)=SUMPRODUCT(B2:B5; C2:C5)
3Boiler 80 L1212€389.00€ 389,00
4Radiator valve150150€12.40€ 12,40
5Thermostat3535€58.50€ 58,50
6
Formula cell (E2)Input

Formula in E2

=SUMPRODUCT(B2:B5, C2:C5)
=SUMPRODUCT(B2:B5; C2:C5)

Result: €9,739.50€ 9.739,50

Step by step
  1. 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.
  2. It multiplies the first items: 240 × 4.85 = 1,1641.164. Then the second: 12 × 389 = 4,6684.668.
  3. Then the third and fourth: 150 × 12.4 = 1,8601.860 and 35 × 58.5 = 2,047.52.047,5.
  4. 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.
  5. 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.

Sheet excerpt: F2 holds the formula
RowABCDEFG
1JournalNet amountVAT rateJournalRecalculated VAT
2VRK€1,000.00€ 1.000,0021%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)
3INK€2,400.00€ 2.400,0021%21%INK
4VRK€500.00€ 500,00-
5VRK€800.00€ 800,009%9%
6INK€300.00€ 300,009%9%
7INK€1,500.00€ 1.500,0021%21%
8
Formula cell (F2)Input

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
  1. Excel evaluates the comparison first: each cell of $A$2:$A$7 against E2 (VRK). That gives TRUE, FALSE, TRUE, TRUE, FALSE, FALSE.
  2. 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.
  3. 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.
  4. 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.
  5. The products add up to 210 + 0 + 72 = 282, the recalculated VAT on the sales journal in F2.
  6. Copy F2 to F3. The $ signs keep the three data ranges fixed and only E2 moves to E3 (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.

Sheet excerpt: G4 holds the formula
RowABCDEFGH
1Entry no.JournalAccountAmountJournal 1MEM
225-0401VRK80008000€12,500.00€ 12.500,00Journal 2BNK
325-0402MEM80008000€4,800.00€ 4.800,00Account€8,000.00€ 8.000,00
425-0403BNK11001100€3,200.00€ 3.200,00Total€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)
525-0404MEM45004500€950.00€ 950,00
625-0405BNK80008000€1,750.00€ 1.750,00
725-0406VRK80008000€9,300.00€ 9.300,00
825-0407MEM80008000€2,250.00€ 2.250,00
9
Formula cell (G4)Input

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
  1. 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}.
  2. 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.
  3. (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.
  4. SUMPRODUCT now multiplies that array with D2:D8 and adds: 1 × 4,8004.800 + 1 × 1,7501.750 + 1 × 2,2502.250 = 8,8008.800. Entry 25-0403 (BNK, account 1100) and 25-0404 (MEM, account 4500) were switched off by the account test.
  5. Change G3 to 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.

Sheet excerpt: F2 holds the formula
RowABCDEFG
1RelationInvoice amountDays to payRelationD1001
2D1001€12,000.00€ 12.000,003030Weighted days43.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)) )
3D1002€8,000.00€ 8.000,004545
4D1001€3,000.00€ 3.000,00
5D1001€25,000.00€ 25.000,006060
6D1002€15,000.00€ 15.000,003838
7D1001€10,000.00€ 10.000,002020
8D1003€6,000.00€ 6.000,009090
9
Formula cell (F2)Input

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
  1. keep compares A2:A8 with F1 (D1001), {1; 0; 1; 1; 0; 1; 0}, and multiplies by ISNUMBER(C2:C8), which is FALSE only for the blank in C4: {1; 1; 0; 1; 1; 1; 1}. The product is {1; 0; 0; 1; 0; 1; 0}: D1001 invoices that have been paid.
  2. 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.
  3. 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 C4 meets a weight of 0, so it adds nothing either way.
  4. 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.
  5. 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.
  6. 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

Common mistakes
SymptomCauseFix
#VALUE! when the ranges differ in sizeThe 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-12You 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 columnsA 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)