edubun
English
1 / 19

4 / 6 · Intro

Adding up with SUM

If one cell in a column holds the text n/a, =B2+B3+B4 shows #VALUE!, while =SUM(B2:B4) skips the text and adds the rest.

Jump to the 10 practice questions

You will learn

  • Add a range with SUM
  • Spot text that SUM silently skips

Before this: Writing your first formulas

1Explain

Your first function

A function is a named calculation that takes inputs in brackets. SUM adds numbers. Its inputs, called arguments, can be numbers, cell references, ranges or any mix: =SUM(4,6), =SUM(B2:B13) and =SUM(B2:B13,D2) all work. Commas separate the arguments. Microsoft's page says Excel's SUM takes up to 255 of them, and Google's help says Sheets accepts any number. In practice one or two ranges are enough, because a single range can cover thousands of cells.

2Problem

=SUM(4,6,10)

What does =SUM(4,6,10) return?

Hint

4 + 6 + 10.

Solution

Answer: 20

Typed numbers can be arguments too: 4 + 6 + 10 = 20.

3Problem

Arguments in Excel

How many numbers can Excel's SUM take as separate arguments?

Hint

The number from the paragraph.

Solution

Answer: 255

Microsoft: number1 to number255. Google Sheets has no fixed limit.

4Explain

SUM or a chain of plus signs

Writing =B2+B3+B4+B5+B6 gives the same total as =SUM(B2:B6) when every cell holds a number, but Microsoft lists reasons to prefer SUM. The long version is easy to mistype. It breaks with #VALUE! if any of the cells holds text, because + must turn every piece into a number and cannot turn n/a into one. SUM ignores text values in a range and adds only the numbers. And when you insert a row inside the range, SUM grows to include it, while a chain of + signs does not.

B4 holds text, shown on the left. =SUM(B2:B6) in B7 skips it and gives 455; =B2+B3+B4+B5+B6 would give #VALUE!.

5Problem

SUM over a text cell

B2:B6 holds 120, 95, the text n/a, 130 and 110. What does =SUM(B2:B6) return?

Hint

120 + 95 + 130 + 110.

Solution

Answer: 455

SUM skips the text: 120 + 95 + 130 + 110 = 455.

6Problem

The plus chain

Same cells. What does =B2+B3+B4+B5+B6 return?

Hint

+ cannot turn n/a into a number.

Solution

Answer: #VALUE!

+ has to turn n/a into a number and cannot.

7Explore

The same in JavaScript

The first way keeps only numbers, like SUM. The second adds everything: JavaScript has no #VALUE!, so the text glues the numbers into one long string.

Way
const cells = [120, 95, "n/a", 130, 110];
console.log(cells.filter((c) => typeof c === "number").reduce((a, b) => a + b, 0));
Output
455

8Explain

When skipping text hurts

Skipping text is helpful and dangerous at the same time. If a figure was typed as text by mistake, such as a number pasted with a stray space or apostrophe, SUM leaves it out without any warning and the total is simply too small. The left alignment from the previous unit is the clue to look for, and the lab's panel shows the kind of every value a formula used.

9Problem

A price pasted as text

A price was pasted as text by mistake. What does SUM do with it?

Hint

No warning at all.

Solution

Answer: Leaves it out without warning

Text in a range is ignored, so the total is quietly too small.

10Explain

Colons and commas

The colon and the comma do different jobs. B2:B6 means every cell from B2 to B6, five cells. B2,B6 means just those two cells. Microsoft calls them the range operator and the union operator. So =SUM(B2:B3,B6) adds three cells, B2, B3 and B6. One more detail: in some languages and regions the comma is used as the decimal mark, and there the spreadsheet expects semicolons between arguments, as in =SUM(B2:B3;B6). The rule is the same, only the separator changes.

11Problem

The colon

What does the colon in B2:B6 mean?

Hint

Every cell from one corner to the other.

Solution

Answer: Every cell from B2 to B6

The colon includes both endpoints and every cell between them, unlike a comma that separates individual arguments.

12Problem

B2:B3,B6

How many cells does =SUM(B2:B3,B6) add?

Hint

Two from the range, one more.

Solution

Answer: 3

B2:B3 is two cells, plus B6.

13Problem

Their total

With 120, 95 and 110 in B2, B3 and B6, what does =SUM(B2:B3,B6) return?

Hint

120 + 95 + 110.

Solution

Answer: 325

120 + 95 + 110 = 325.

14Problem

Comma as the decimal mark

In regions that use a comma as the decimal mark, how are SUM arguments separated?

Hint

A different separator.

Solution

Answer: Semicolons

=SUM(B2:B3;B6): only the separator changes.

15Explain

AutoSum and the total row

Both programs have a sum button marked with the Greek letter Σ. In Excel it is AutoSum on the Home tab; in Google Sheets it is in the Functions menu on the toolbar. Select the cell under a column of numbers, press it, and the program proposes a range. Check the proposed range before pressing Enter, because it stops at the first empty cell or label it meets. Selecting a block of numbers also shows their sum at the bottom of the window, which is handy for a quick look without writing anything.

16Problem

=SUM(A1:A4)/4

A1:A4 holds 2, 4, 6 and 8. What does =SUM(A1:A4)/4 return?

Hint

20 ÷ 4.

Solution

Answer: 5

20 / 4 = 5, the average. The AVERAGE function does this in one step.

17Explore

Practice in the grid

A good habit is to keep totals out of the range they add up. If the total for B2:B6 sits in B7 and the formula is =SUM(B2:B7), it includes itself, which is a circular reference and produces an error or a warning. Put a label such as Total in the cell to the left of the result so readers know what the number is, and leave the column of figures with nothing but figures in it. Then both SUM and anyone reading the sheet can trust the column.

Loading

Drag to turn. Scroll or pinch to zoom.

B8 already holds the chain of plus signs and shows #VALUE!. Select it and read why. When the tasks are done, change B4 to 100: B8 starts working and B7 grows to 555.

18Practice

A SUM that skips text

Finish sumNumbers(cells) so that it adds only the numbers and skips text, like SUM. With no numbers at all it returns 0.

Expected output
455
20
0
Your code
function sumNumbers(cells) {
  let total = 0;
  for (const c of cells) total += c;
  return total;
}
console.log(sumNumbers([120, 95, "n/a", 130, 110]));
console.log(sumNumbers([4, 6, 10]));
console.log(sumNumbers(["x", "y"]));
Hint

typeof c === "number" is true only for numbers.

A solution
function sumNumbers(cells) {
  let total = 0;
  for (const c of cells) {
    if (typeof c === "number") total += c;
  }
  return total;
}
console.log(sumNumbers([120, 95, "n/a", 130, 110]));
console.log(sumNumbers([4, 6, 10]));
console.log(sumNumbers(["x", "y"]));

19

Summary

  • =SUM(range) adds the numbers in a range and skips text.
  • A chain of + signs breaks with #VALUE! when a cell holds text.
  • Colon = range, comma = separate pieces.
  • Excel SUM takes up to 255 arguments; Google Sheets has no fixed limit.

Next unitCopying formulas: relative references
Full text · The whole lesson as one text

Your first function

A function is a named calculation that takes inputs in brackets. SUM adds numbers. Its inputs, called arguments, can be numbers, cell references, ranges or any mix: =SUM(4,6), =SUM(B2:B13) and =SUM(B2:B13,D2) all work. Commas separate the arguments. Microsoft's page says Excel's SUM takes up to 255 of them, and Google's help says Sheets accepts any number. In practice one or two ranges are enough, because a single range can cover thousands of cells.

Writing =B2+B3+B4+B5+B6 gives the same total as =SUM(B2:B6) when every cell holds a number, but Microsoft lists reasons to prefer SUM. The long version is easy to mistype. It breaks with #VALUE! if any of the cells holds text, because + must turn every piece into a number and cannot turn n/a into one. SUM ignores text values in a range and adds only the numbers. And when you insert a row inside the range, SUM grows to include it, while a chain of + signs does not.

Skipping text is helpful and dangerous at the same time. If a figure was typed as text by mistake, such as a number pasted with a stray space or apostrophe, SUM leaves it out without any warning and the total is simply too small. The left alignment from the previous unit is the clue to look for, and the lab's panel shows the kind of every value a formula used.

Colons and commas

The colon and the comma do different jobs. B2:B6 means every cell from B2 to B6, five cells. B2,B6 means just those two cells. Microsoft calls them the range operator and the union operator. So =SUM(B2:B3,B6) adds three cells, B2, B3 and B6. One more detail: in some languages and regions the comma is used as the decimal mark, and there the spreadsheet expects semicolons between arguments, as in =SUM(B2:B3;B6). The rule is the same, only the separator changes.

B4 holds text, shown on the left. =SUM(B2:B6) in B7 skips it and gives 455; =B2+B3+B4+B5+B6 would give #VALUE!.

Both programs have a sum button marked with the Greek letter Σ. In Excel it is AutoSum on the Home tab; in Google Sheets it is in the Functions menu on the toolbar. Select the cell under a column of numbers, press it, and the program proposes a range. Check the proposed range before pressing Enter, because it stops at the first empty cell or label it meets. Selecting a block of numbers also shows their sum at the bottom of the window, which is handy for a quick look without writing anything.

A good habit is to keep totals out of the range they add up. If the total for B2:B6 sits in B7 and the formula is =SUM(B2:B7), it includes itself, which is a circular reference and produces an error or a warning. Put a label such as Total in the cell to the left of the result so readers know what the number is, and leave the column of figures with nothing but figures in it. Then both SUM and anyone reading the sheet can trust the column.

B8 already holds the chain of plus signs and shows #VALUE!. Select it and read why. When the tasks are done, change B4 to 100: B8 starts working and B7 grows to 555.

Check for repeated values before trusting a total assembled from several blocks. A subtotal may already contain the entries that another selected range adds again. The arithmetic can be correct while the same contribution is counted twice. Describe each block’s role and mark which entries it covers. If the coverage overlaps, decide whether to add the original entries or their subtotal, rather than including both. This is a selection problem, not a failure of addition.

Key points
  • =SUM(range) adds the numbers in a range and skips text.
  • A chain of + signs breaks with #VALUE! when a cell holds text.
  • Colon = range, comma = separate pieces.
  • Excel SUM takes up to 255 arguments; Google Sheets has no fixed limit.

Practice questions from Adding up with SUM on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (15)
  • Microsoft Support, "Excel specifications and limits" (support.microsoft.com/en-us/office/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3: 1,048,576 rows by 16,384 columns, 15-digit precision, 255 arguments)
  • "Calculation operators and precedence in Excel" (.../calculation-operators-and-precedence-in-excel-48be406d-4975-4d31-b2b8-7af9e0e2878a: operators, order negation % ^ * / + - & comparisons, =5+2*3 is 11, ="1"+"2" is 3, ="A"&TRUE is ATRUE, #### for too little space)
  • "SUM function" (.../sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89: up to 255 numbers, =A1+B1+C1 gives #VALUE! with text while SUM ignores text)
  • "Switch between relative, absolute, and mixed references" (.../dfec08cd-ae65-4f56-839e-5f0d8d0baca9: =B4*C4 copied from D4 to D5 becomes =B5*C5)
  • "Date systems in Excel" (.../e7fe7167-48a9-4b96-bb53-5612a800b487: July 5, 2011 is 40729 in the 1900 system and 39267 in the 1904 system, 1,462 days apart)
  • "Remove or allow a circular reference" (.../8540bd0f-6e97-4483-bcf7-1b49cd50d123: warning, then 0 or the last value)
  • VLOOKUP and IF pages (#N/A, #NAME? from missing quotes)
  • Google Docs Editors Help: SUM (support.google.com/docs/answer/3093669: any number of arguments)
  • DATE (answer/3092969: days counted from December 30, 1899)
  • Keyboard shortcuts for Google Sheets (answer/181110: Ctrl+D fill down, Ctrl+R fill right, Ctrl+~ show all formulas, F4 absolute/relative)
  • Files you can store in Google Drive (support.google.com/drive/answer/37603: up to 20 million cells per spreadsheet)
  • ERROR.TYPE (answer/3238305: the error values)
  • History: Smithsonian National Museum of American History, VisiCalc software and documentation, object nmah_1696121 (Bricklin and Frankston, Apple II, 1979)
  • ACM Interactions, "The first killer app: a history of spreadsheets" (2013: Lotus 1-2-3, Excel for the Macintosh in 1985)
  • Wikipedia, VisiCalc and Lotus 1-2-3 (VisiCalc used A1 notation; Lotus 1-2-3 launched 1983).

Checked: 2026-10-17