Lesson 53 of 92 · Free Excel Course
Excel
Excel Summation Formula: SUM, Running Totals and SUMPRODUCT
Every Excel summation formula in one place: SUM variations, running totals, SUMPRODUCT for weighted averages and multi-condition sums, SUMIFS vs SUMPRODUCT, and Σ.
"Summation" just means adding things up, and Excel has more than one way to do it. SUM covers most days. A running total shows the sum growing row by row. SUMPRODUCT multiplies and adds in one step, which gives you weighted averages and sums with conditions, including the OR conditions that SUMIFS can't do. This lesson shows each one on the same eight sales, checks that the different methods give the same answer, and ends with what the Σ symbol in a textbook means in Excel terms. If you've never used SUM, start with how to add and sum and come back.
The sales data
Open the Practice sheet in the practice workbook. Eight sales sit in A1:D9. Column E (Revenue) and column F (Running total) are yellow, ready for your formulas.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Rep | Region | Units | Price | Revenue | Running total |
| 2 | Ana | East | 12 | $25.00 | $300 | $300 |
| 3 | Ben | West | 8 | $40.00 | $320 | $620 |
| 4 | Cara | East | 15 | $18.00 | $270 | $890 |
| 5 | Dev | North | 7 | $60.00 | $420 | $1,310 |
| 6 | Eli | West | 22 | $15.00 | $330 | $1,640 |
| 7 | Fay | East | 4 | $45.00 | $180 | $1,820 |
| 8 | Gus | North | 13 | $30.00 | $390 | $2,210 |
| 9 | Hana | West | 9 | $50.00 | $450 | $2,660 |
In E2 type =C2*D2 and copy it down to E9. You now have a revenue figure for every sale.
SUM variations: ranges, whole columns and AutoSum
The basic summation formula is =SUM(range). SUM accepts up to 255 arguments, and each one can be a single cell, a range or a number. On the Practice sheet, fill in I2:I4:
- One range: in I2 type
=SUM(E2:E9). Result: $2,660. - Room to grow: in I3 type
=SUM(E2:E500). Empty cells add nothing, so the total is the same until you add sales below row 9. A whole column,=SUM(E:E), also works and ignores the header text, but only in a cell outside column E. Put it inside column E and the formula includes itself, which is a circular reference. - Several ranges: in I4 type
=SUM(E2:E5,E7:E9). That skips Eli's row 6 and gives $2,330. To build it by clicking, type=SUM(, drag over E2:E5, hold Ctrl (Cmd on a Mac) and drag over E7:E9. Excel adds the comma for you. - AutoSum: click E10 and press Alt+=. Excel writes
=SUM(E2:E9)and outlines the range. Press Enter. On a Mac the shortcut is Shift+Cmd+T; in Excel for the web, click AutoSum on the Home tab. AutoSum stops at the first empty cell, so check the outline before you press Enter. Delete E10 afterwards so it doesn't get counted in step 2.
To add the same cell on several sheets (Jan, Feb, Mar…), use a 3-D reference such as =SUM(Jan:Mar!B2). The add and sum lesson walks through it, including the quotes you need when a sheet name has a space.
Running totals with SUM($E$2:E2)
A running (cumulative) total shows how the sum builds up, row by row: money spent so far this month, or sales to date.
- Click F2 and type
=SUM($E$2:E2). Press Enter. It shows $300. - Copy F2 down to F9 (double-click the fill handle).
- Check the last cell: F9 must say $2,660, the same as I2. If it doesn't, a row is missing.
The trick is the mix of references. $E$2 is locked, so the range always starts at the top. E2 has no dollar signs, so it becomes E3, E4 and so on as you copy down. In F5 the formula reads =SUM($E$2:E5): $300 + $320 + $270 + $420 = $1,310. The absolute and relative references lesson explains the dollar signs in detail.
SUMPRODUCT: multiply and add in one step
=SUMPRODUCT(array1, [array2], ...) multiplies the first item of each range together, then the second items, and so on, and adds up all the products. All the ranges must be the same size, or you get #VALUE!.
In I5 type =SUMPRODUCT(C2:C9,D2:D9). Excel works out 12×25 + 8×40 + 15×18 and so on, and returns $2,660. That's the same total as SUM of the Revenue column, without needing the Revenue column at all.
Weighted average price
The plain average of the eight prices, =AVERAGE(D2:D9) in I7, is $35.38. But that treats Dev's 7 units at $60 the same as Eli's 22 units at $15. The real average price paid per unit is total revenue divided by total units:
| H | I | |
|---|---|---|
| 6 | Total units | 90 |
| 7 | Simple average price | $35.38 |
| 8 | Weighted average price | $29.56 |
The pattern for any weighted average is =SUMPRODUCT(values, weights)/SUM(weights). Dividing by the sum of the weights means it still works when the weights don't add up to 1 or 100%.
Weighted grade
Rows 21 to 27 of the Practice sheet hold a course grade: homework 15%, quizzes 15%, midterm 30%, final exam 40%.
| A | B | C | |
|---|---|---|---|
| 21 | Weighted grade | Weight | Score |
| 22 | Homework | 15% | 98 |
| 23 | Quizzes | 15% | 92 |
| 24 | Midterm | 30% | 74 |
| 25 | Final exam | 40% | 69 |
| 26 | Weighted grade | 78.3 | |
| 27 | Plain average (wrong here) | 83.25 |
Sums with conditions in SUMPRODUCT
Inside SUMPRODUCT, a test like B2:B9="East" gives a list of TRUE and FALSE values, one per row. Multiply that list by a number and TRUE becomes 1 and FALSE becomes 0. That's how SUMPRODUCT adds only the rows you want.
One condition, no helper column. =SUMPRODUCT((B2:B9="East")*C2:C9*D2:D9) in I12 multiplies units by price only for the East rows: $300 + $270 + $180 = $750. SUMIFS can't do this, because it can only add a column that already exists.
The -- trap. Try =SUMPRODUCT((B2:B9="East"),E2:E9) in I10. It returns $0. SUMPRODUCT treats anything that isn't a number as zero, and TRUE isn't a number until you do maths with it. Put two minus signs in front of the test, =SUMPRODUCT(--(B2:B9="East"),E2:E9) in I11, and you get $750. The first minus turns TRUE into −1, the second turns it back to 1. *1 or multiplying the tests together does the same thing.
AND: multiply the tests. East sales with more than 10 units:
| H | I | |
|---|---|---|
| 13 | East AND units >10 (SUMIFS) | $570 |
| 14 | East AND units >10 (SUMPRODUCT) | $570 |
| 15 | East OR North (SUMPRODUCT) | $1,560 |
| 16 | East OR North (two SUMIFS) | $1,560 |
Multiplying works because 1 × 1 = 1 only when both tests are TRUE. Any FALSE makes the row 0.
OR: add the tests. East or North sales: =SUMPRODUCT(((B2:B9="East")+(B2:B9="North"))*E2:E9) gives $1,560. A row can't be East and North at once, so each row adds 1 or 0.
OR across two columns needs a >0 test. East or more than 10 units: Ana and Cara pass both tests, so the plain + version scores them 2 and counts them twice, giving $2,040. Wrap the sum in a >0 test so each row counts once:
=SUMPRODUCT((((B2:B9="East")+(C2:C9>10))>0)*E2:E9)
That returns the right answer, $1,470 (Ana, Cara, Fay, Eli and Gus).
SUMPRODUCT or SUMIFS?
Both give the same answer for AND conditions: on the Answers sheet, =SUMIFS(E2:E9,B2:B9,"East",C2:C9,">10") and the SUMPRODUCT version both show $570. Choose like this:
| Situation | Better choice | Why |
|---|---|---|
| All conditions must be true, adding an existing column | SUMIFS | Faster and easier to read |
| Big data sets or whole-column ranges | SUMIFS | SUMPRODUCT calculates every cell you give it |
| OR between conditions | SUMPRODUCT | SUMIFS only does AND |
| Multiply columns first (units × price) | SUMPRODUCT | SUMIFS can't calculate inside its ranges |
| A function on the range, like MONTH(A2:A9)=3 | SUMPRODUCT | SUMIFS criteria can't wrap a function around the range |
Microsoft's own performance guidance says to use SUMIFS, COUNTIFS and AVERAGEIFS instead of SUMPRODUCT wherever they can do the job, and to avoid whole-column references in SUMPRODUCT. For an OR on a single column, adding two SUMIFS works too: =SUMIFS(E2:E9,B2:B9,"East")+SUMIFS(E2:E9,B2:B9,"North") gives the same $1,560. The COUNTIF, SUMIF and AVERAGEIF lesson covers SUMIFS criteria in depth.
SUMSQ and the Σ (sigma) notation in plain English
SUMSQ squares each number and adds the squares. =SUMSQ(3,4) is 9 + 16 = 25. On the sales data, =SUMSQ(C2:C9) gives 1,232 (144 + 64 + 225 + … + 81). Statisticians use sums of squares for variance, which statistics in Excel covers.
In maths books, the Greek capital letter Σ (sigma) means "add up everything that follows". The small letters tell you what to add:
| Notation | Read it as | In Excel |
|---|---|---|
| Σxᵢ | add all the x values | =SUM(C2:C9) |
| Σxᵢwᵢ | multiply each x by its weight w, then add | =SUMPRODUCT(C2:C9,D2:D9) |
| Σxᵢ² | square each x, then add | =SUMSQ(C2:C9) |
| Σi, i = 1 to 10 | add 1 + 2 + … + 10 | =SUM(SEQUENCE(10)) → 55 |
The i is just a counter: "for i from 1 to n" means "for every row". SEQUENCE needs Microsoft 365 or Excel 2021 or later (Windows, Mac and the web). In older versions, type 1 to 10 in a column and SUM it. Excel's AutoSum button is drawn as a Σ for exactly this reason. Multiplying instead of adding? That's the PRODUCT function.
Try it yourself
Download the practice workbook. The Practice sheet has yellow cells for every formula; the Answers sheet has them filled in, with each formula written out as text in column J.
- Fill E2:E9 with
=C2*D2and F2:F9 with=SUM($E$2:E2). F9 must equal $2,660. - Fill I2:I4 with the three SUM variations ($2,660, $2,660, $2,330), then try AutoSum in E10.
- Total revenue with
=SUMPRODUCT(C2:C9,D2:D9)in I5, and compare the simple ($35.38) and weighted ($29.56) average price in I7:I8. - Fill I9:I14 and check that SUMIFS and SUMPRODUCT agree ($750 and $570). See the $0 trap in I10, then fix it with -- in I11.
- Do the OR sums in I15:I18 and spot the double count ($2,040 vs $1,470).
- Work out SUMSQ (1,232) in I19, the Σ example (55) in I20 and the weighted grade (78.3) in C26.
Common mistakes
- Ranges of different sizes in SUMPRODUCT.
=SUMPRODUCT(C2:C9,D2:D8)returns #VALUE!. Every range must have the same number of rows and columns. - *Forgetting the -- (or the ).
=SUMPRODUCT((B2:B9="East"),E2:E9)quietly returns 0, not an error. - Commas between conditions. In SUMPRODUCT, conditions must be multiplied together:
(test1)*(test2)*values. Writing(test1),(test2),valuesleaves the TRUE/FALSE lists uncounted. - Adding OR tests that can both be true. Use
>0around the sum, or rows are counted twice. - No $ in a running total.
=SUM(E2:E2)copied down only ever adds one row. - A whole-column SUM inside its own column.
=SUM(E:E)typed in E10 is a circular reference. Put the total in another column, or use a fixed range. - Averaging weighted data with AVERAGE. When rows carry different weight, use SUMPRODUCT ÷ SUM of the weights.
What's next
You can now add up a range, build a running total, weight an average and sum with AND or OR conditions. The previous lesson, trace precedents and auditing, shows how to check which cells feed a total like these. Next, the Excel formulas list gathers every formula in the course in one place. Or go back to the full Excel course.
Frequently asked questions
What is the summation formula in Excel?
It's the SUM function: =SUM(B2:B9) adds every number in B2 to B9. You can list several ranges, like =SUM(B2:B5,B7:B9), or press Alt+= (Shift+Cmd+T on a Mac) to let AutoSum write it for you. For sums with a twist (multiply first, or only some rows), use SUMPRODUCT or SUMIFS.
How do I make a running total in Excel?
In the first row type =SUM($E$2:E2) and copy it down. The $ signs lock the start of the range while the end moves down one row at a time, so each cell adds everything from the top to that row. The last running total should equal the grand total, which is a handy check.
What does SUMPRODUCT do in Excel?
It multiplies matching items in two or more ranges and adds up the results. =SUMPRODUCT(C2:C9,D2:D9) works out units × price for every row and totals it, so you get total revenue without a helper column. Divide by SUM of the weights to get a weighted average: =SUMPRODUCT(C2:C9,D2:D9)/SUM(C2:C9).
What does -- mean in an Excel formula?
The double negative (double unary) turns TRUE and FALSE into 1 and 0. SUMPRODUCT treats anything that isn't a number as zero, so =SUMPRODUCT((B2:B9="East"),E2:E9) returns 0. Adding -- in front of the test, =SUMPRODUCT(--(B2:B9="East"),E2:E9), makes it count. Multiplying the tests together with * does the same job.
Should I use SUMPRODUCT or SUMIFS?
Use SUMIFS when every condition must be true and you're adding a column that already exists: it's faster and easier to read, and Microsoft recommends it where possible. Use SUMPRODUCT when you need OR logic, need to multiply columns first, or need a function applied to the range (like MONTH or LEN).
How do I write sigma (Σ) notation in Excel?
Σ just means "add them all up". Σxᵢ is =SUM(range), Σxᵢwᵢ (each value times its weight) is =SUMPRODUCT(values,weights), Σxᵢ² is =SUMSQ(range), and Σi for i = 1 to 10 is =SUM(SEQUENCE(10)), which gives 55.