Find a course

Module 2: Formulas and FunctionsLesson 4 of 1212 min

Essential Functions: SUM to ROUND

Use SUM, AVERAGE, MIN, MAX, COUNT, COUNTA and ROUND correctly, including how blanks, zeros and text change their results.

Step 1 of 12Learn

Functions: ready-made formulas

Adding 200 cells with =B2+B3+B4+… would be absurd. A function is a named, built-in calculation that does the work for you. Every function follows the same pattern:

=FUNCTIONNAME(argument1, argument2, …)

The arguments are the inputs, separated by commas. For SUM they can be ranges, single cells or numbers: =SUM(B2:B200), =SUM(B2:B10, D2:D10), =SUM(B2:B10, 500).

Fastest way to total a column: select the empty cell just below the numbers and press Alt+= (Cmd+Shift+T on a Mac). That's AutoSum: Excel guesses the range and writes =SUM(...) for you. Check the guess before pressing Enter; it stops at the first blank cell.

As you type a function name, Excel shows a list of matching functions and then a tooltip with the arguments it expects. Arguments in square brackets, such as [num2], are optional. Function names are not case sensitive, so =sum(b2:b9) becomes =SUM(B2:B9) automatically.

A nice property of ranges: if you insert a row inside a summed range, the range grows automatically. Insert a row between rows 5 and 6 and =SUM(B2:B10) becomes =SUM(B2:B11). Add rows below the last row, though, and the range often does not grow, a classic reason totals miss new data. Excel Tables (Module 4) solve this for good.

Step 2 of 12Practice · Diagram

Anatomy of =SUM(B2:B10, D2, 50)

Which argument covers the most cells?

Tap the shape that answers the question, then press Check.

Anatomy of =SUM(B2:B10, D2, 50)Parts diagram: =SUM(B2:B10, D2, 50), =, SUM, B2:B10, D2, 50, Commas and parentheses.=SUM(B2:B10,D2, 50)=SUMB2:B10D250Commas andparentheses
=SUM(B2:B10, D2, 50)
=

Every formula starts here.

SUM

The function name.

B2:B10

First argument: a range of nine cells.

D2

Second argument: a single cell.

50

Third argument: a typed number.

Commas and parentheses

Parentheses hold the arguments; commas separate them (semicolons in some regions).

Step 3 of 12Learn

The big six

These six functions answer most "how much, how many, how big" questions. Suppose B2:B7 contains 40, 25, (blank), 60, "n/a" and 35:

FunctionWhat it doesResult
=SUM(B2:B7)adds the numbers160
=AVERAGE(B2:B7)sum of numbers ÷ count of numbers40
=MIN(B2:B7)smallest number25
=MAX(B2:B7)largest number60
=COUNT(B2:B7)how many cells hold numbers4
=COUNTA(B2:B7)how many cells are not empty5

Notice what happened to the blank cell and the text "n/a": SUM, AVERAGE, MIN, MAX and COUNT simply ignore them. AVERAGE therefore divides 160 by 4, not 6. COUNTA counts the text cell because it isn't empty, but not the blank one.

This is usually helpful, but it can hide problems. If "n/a" really meant zero sales, the average should be 160 ÷ 5 = 32, not 40. Decide what blanks and text mean in your data, and enter real zeros when the true value is zero.

Need the spread of the data? =MAX(B2:B7)-MIN(B2:B7) gives the range, 35 here. Want a count of empty cells? =COUNTBLANK(B2:B7) returns 1.

Step 4 of 12Try the calculator

Function playground

Enter five values, as if they were in A1:A5, and compare the functions.

=SUM(A1:A5)
50
=AVERAGE(A1:A5)
10
=MIN(A1:A5)
0
=MAX(A1:A5)
20
=MAX(A1:A5)-MIN(A1:A5)
20
=ROUND(AVERAGE(A1:A5),0)
10

Step 5 of 12Practice · Choose one

C2:C9 holds 5 numbers, 2 text labels and 1 empty cell. What do =COUNT(C2:C9) and =COUNTA(C2:C9) return?

Step 6 of 12Learn

Blanks, zeros and rounding

A blank cell and a zero are not the same to Excel. Scores of 80, (blank), 90, 0 and 70:

  • =AVERAGE gives (80 + 90 + 0 + 70) / 4 = 60. The zero counts; the blank does not.
  • If the blank was really a missed test worth zero, the honest average is 240 / 5 = 48.

So before averaging, decide whether blanks mean "no data" or "zero" and fill them accordingly.

Rounding. Formatting hides decimals, but ROUND changes the actual value:

  • =ROUND(2.345, 2) returns 2.35 (2 decimal places; 5 and above rounds up).
  • =ROUND(2.344, 2) returns 2.34.
  • =ROUND(1875, -2) returns 1900. Negative digits round to the left of the decimal point: tens, hundreds, thousands.
  • =ROUNDUP(2.301, 0) returns 3 and =ROUNDDOWN(2.999, 0) returns 2, always moving in one direction.

Round when the rounded figure is the real one: cents on invoices, whole units you can only buy in whole numbers (boxes, seats, staff). Planning 7.2 boxes of paper means buying 8, so =ROUNDUP(7.2, 0). Avoid rounding intermediate results in long calculations, since each rounding adds a little error; round the final answer instead.

Step 7 of 12Practice · Work it out

A range holds 80, (blank), 90, 0 and 70. What does =AVERAGE of that range return?

Step 8 of 12Practice · Chart

One blank cell, two different averages

If the blank was really a missed test worth zero, which bar is the honest average?

Tap the bar that answers the question, then press Check.

One blank cell, two different averagesBar chart with 2 categories: Blank skipped by AVERAGE: 60; Blank filled in as 0: 48.020406080100Blank skipped by AVERAGEBlank filled in as 06048
Scores 80, (blank), 90, 0, 70 from the lesson.
One blank cell, two different averages
ItemAverage score
Blank skipped by AVERAGE60
Blank filled in as 048

Step 9 of 12Practice · Fill in the blanks

Fill in the blanks

=ROUND(3.14159, 2) returns , and =ROUND(1875, -2) returns .

Step 10 of 12Note

Step 11 of 12Practice · Match the pairs

Match each question to the function that answers it.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. What is the total of all invoices?
  2. How many cells contain anything at all?
  3. What was the lowest daily temperature?
  4. How many cells contain numbers?
  5. What is the typical order size, the arithmetic mean?

Step 12 of 12Practice · True or false

If =SUM(B2:B10) is in B11 and you insert a new row between rows 5 and 6, the formula changes to =SUM(B2:B11) and includes the new row.