Which Formula Totals Cells B2 to B6? SUM vs COUNT vs AVERAGE vs MAX
- The answer is
=SUM(B2:B6). It is the only one of the four that adds the numbers together. - The other three answer different questions:
COUNTasks how many,AVERAGEasks what is typical,MAXasks what is biggest. - The colon in
B2:B6means through, so it covers all five cells. A comma would mean and, and would add only the two cells you named. - If SUM returns 0, your numbers are almost certainly stored as text. The giveaway is that they sit on the left of the cell instead of the right.
- You never have to type it. Click below the numbers and press
Altand=together, and Excel writes the formula for you.
The short answer
=SUM(B2:B6) is correct. SUM means "add these up," and that is exactly what a total is.
The other three options look similar because they are all written the same way — a function name, a bracket, a range of cells — but each one does something completely different with those same five cells. Below is what each one gives you, so the distinction sticks rather than having to be memorised.
All four functions, same five numbers
Suppose cells B2 to B6 contain these values: 12, 7, 25, 7 and 4. Type each formula into an empty cell and here is what comes back.
| Formula | Result | The question it answers |
|---|---|---|
=SUM(B2:B6) | 55 | How much altogether? It adds 12 + 7 + 25 + 7 + 4 |
=COUNT(B2:B6) | 5 | How many cells have a number in them? It never looks at how big they are |
=AVERAGE(B2:B6) | 11 | What is the typical value? It is SUM divided by COUNT, so 55 ÷ 5 |
=MAX(B2:B6) | 25 | What is the largest single value? It ignores the other four entirely |
Notice that the AVERAGE result, 11, looks like a perfectly reasonable number. That is the real reason this question gets asked: a wrong formula here does not produce an error message or a red warning. It produces a believable number that happens to answer a question you did not ask. Nothing in the spreadsheet will tell you.
What the colon actually means
This is the part most explanations skip, and it is worth thirty seconds because it unlocks every other formula you will ever write.
The colon means through. So B2:B6 means "B2 through B6" — all five cells, including both ends.
A comma means and. So =SUM(B2,B6) adds only B2 and B6, which with our numbers gives 16 rather than 55. It skips the three cells in the middle because you never mentioned them.
You can mix them. =SUM(B2:B6, D2:D6) means "everything from B2 through B6, and also everything from D2 through D6." Excel will happily add cells from anywhere in the workbook this way, as long as each block is separated by a comma.
| What you write | What it means | Result with our numbers |
|---|---|---|
=SUM(B2:B6) | B2 through B6, all five cells | 55 |
=SUM(B2,B6) | Just B2 and B6 | 16 |
=SUM(B2:B4) | B2 through B4, three cells | 44 |
=B2+B3+B4+B5+B6 | The same as SUM, typed out longhand | 55 |
That last row works, and for five cells it is barely slower to type. It is worth knowing why SUM is still the better habit: if you later insert a new row in the middle of the list, SUM(B2:B6) stretches to include it automatically, while the plus-sign version silently leaves it out. The longhand version does not break, which is exactly what makes it dangerous — it just quietly stops being right.
The fast way: never type it at all
Two shortcuts, both worth building into your habits.
AutoSum. Click the empty cell directly below your column of numbers, then press Alt and = together on Windows, or Cmd + Shift + T on a Mac. Excel writes =SUM(B2:B6) for you, having worked out the range from the numbers sitting above. Press Enter to accept it. Glance at the range it guessed before you do, because it stops at the first blank cell it meets.
The status bar. If you only want to see the total and do not need it in a cell, select the five cells and look at the strip along the very bottom of the Excel window. It already shows Sum, Average and Count for whatever you have selected. No formula, nothing added to your sheet. Right-click that strip to add Min, Max and others to what it displays.
Why SUM sometimes returns 0
You typed the formula correctly and got zero. Four causes, in the order they actually happen.
| Cause | How to spot it | Fix |
|---|---|---|
| The numbers are text, not numbers | They sit against the left edge of the cell. Excel pushes real numbers to the right automatically | Select them, click the yellow warning triangle, choose Convert to Number. Or put =VALUE(B2) in a spare column to test one |
| The range points somewhere else | Click the cell with the formula — Excel outlines the range it is actually reading | Retype the range, or drag the outline onto the right cells |
| Excel is showing formulas instead of results | Every formula on the sheet appears as text, not just yours | Press Ctrl + ` (the backtick key, above Tab) to switch back |
| Automatic calculation is switched off | Numbers change but totals do not | Formulas tab, Calculation Options, set to Automatic. Press F9 to force a recalculation now |
The text-not-number one accounts for most cases, and it is especially common in data pasted from a website, a PDF, or an export from another system. Numbers that arrive with a stray space, a currency symbol typed by hand, or a comma in an unexpected place all count as text as far as Excel is concerned. If you are wrestling with this regularly, cleaning messy data covers how to fix a whole column at once.
Two traps in the other three functions
Once you start using COUNT and AVERAGE for real, these two catch nearly everyone.
COUNT skips text, COUNTA does not
COUNT counts cells containing numbers. If two of your five cells contain the word N/A typed in by hand, COUNT returns 3, not 5. When you want "how many cells have anything at all in them," the function is COUNTA — the A stands for all. And when you want "how many are empty," it is COUNTBLANK.
AVERAGE treats blank and zero completely differently
An empty cell is skipped entirely — it does not add to the total and it does not count toward how many items you are dividing by. A cell holding the number 0 is a real value, so it counts as an item and drags the average down.
Say four of five students scored 10, 10, 10 and 10, and the fifth did not sit the test. If that fifth cell is left blank, AVERAGE returns 10. If somebody types a 0 in it, AVERAGE returns 8. Both numbers look fine. Only one of them answers the question that was asked. Whenever an average looks surprising, this is the first thing to check.
What to reach for next
Once plain SUM is comfortable, these three cover most of what everyday spreadsheet work needs.
| You want to | Use | Example |
|---|---|---|
| Total only the rows that match a condition | SUMIF | =SUMIF(A2:A100,"London",B2:B100) totals column B only where column A says London |
| Total on two or more conditions at once | SUMIFS | =SUMIFS(B2:B100,A2:A100,"London",C2:C100,"2026") |
| Total a whole column however long it grows | A Table | Select the data, press Ctrl + T, then write =SUM(Table1[Amount]) |
| Total only the rows a filter is showing | SUBTOTAL | =SUBTOTAL(109,B2:B100) ignores rows hidden by a filter, which plain SUM does not |
That last one is a genuinely useful surprise. SUM adds every cell in the range whether you can see it or not, so filtering a list does not change the total underneath it. SUBTOTAL with a first argument of 109 adds only what is visible, which is almost always what you meant when you filtered.
Not sure which function you need?
Describe what you want in plain English — "total the sales but only for London" — and XLsheetAI writes the formula, explains what each part does, and gives you practice questions so it sticks. Free on iPhone and Android.
Ready for more? The Excel formulas cheat sheet covers the thirty-odd functions worth knowing, IF formula examples is the natural next step once totals make sense, and how to create a pivot table shows how to get dozens of these totals at once without writing a single formula.
FAQ
Which formula correctly calculates the total of cells B2 through B6?
=SUM(B2:B6). SUM is the only one of the four that adds the values together. COUNT(B2:B6) tells you how many of those cells hold a number, AVERAGE(B2:B6) gives the mean, and MAX(B2:B6) returns the single largest value. Only SUM produces a total.
What does the colon mean in =SUM(B2:B6)?
The colon means through, so B2:B6 means every cell from B2 to B6 inclusive, which is five cells: B2, B3, B4, B5 and B6. A comma would mean and instead, so =SUM(B2,B6) would add only those two cells and ignore the three in between.
What is the difference between SUM and COUNT in Excel?
SUM adds the values up and answers how much. COUNT counts how many cells contain a number and answers how many. With the values 12, 7, 25, 7 and 4, SUM returns 55 and COUNT returns 5. COUNT never looks at the size of the numbers, only at whether each cell has one.
Why does my SUM formula return 0?
Nearly always because the numbers are stored as text rather than as numbers, which SUM skips over. The giveaway is that they sit against the left edge of the cell instead of the right, since Excel right-aligns real numbers by default. Select the cells, open the warning triangle that appears, and choose Convert to Number. The other causes are the formula pointing at the wrong range, and Excel being set to show formulas instead of results.
Is there a shortcut to sum a column in Excel?
Click the empty cell directly below your numbers and press Alt and equals together on Windows, or Command, Shift and T on a Mac. That is AutoSum, and it writes the SUM formula with the range already filled in. To read a total without writing any formula at all, just select the cells and look at the status bar along the bottom of the window, which shows Sum, Average and Count.
Does AVERAGE count empty cells as zero?
No. AVERAGE ignores genuinely empty cells completely, so they change neither the total nor the number of items divided by. A cell containing the number zero is different: that is counted as a value, and it pulls the average down. This is the difference behind most averages that look too high or too low, and it is worth checking before trusting one.
XLsheetAI