Formulas and Functions

Calculate with formulas, use SUM, AVERAGE, MIN, MAX, COUNT, IF, and COUNTIF, copy formulas with the fill handle, and lock a reference with a dollar sign.

By the end of this lesson you can

  • Write formulas that start with = and use cell references
  • Use SUM, AVERAGE, MIN, MAX, COUNT, and COUNTA
  • Copy a formula with the fill handle or Ctrl+D, and explain relative and absolute references
  • Make decisions with IF and count matches with COUNTIF
▶ Practice simulation on this page

Video

Watch the lesson video, then complete the reading and challenge.

Presentation Slides

Review the slides below, then complete the reading and challenge.

Formulas and functions in Google Sheets
1 / 6

Lesson Notes

Read through the key concepts before you try the challenge.

Formulas

On the job

You track repair costs for Kim Nguyen.

Kim keeps the cost of every repair in a sheet: parts and labor. Denise wants the total for each repair, the totals for the month, and a flag on any repair that went over Parkview's $300 limit, without anyone adding numbers on a calculator.

Your task: Let the sheet do the math.

  • A formula starts with an equals sign: =C2+D2 adds the values in C2 and D2.
  • Operators: + add, - subtract, * multiply, / divide, and parentheses for order: =(C2+D2)*1.08.
  • Type the formula and press Enter. The cell shows the result; the formula bar shows the formula.
  • Instead of typing a reference, you can click the cell while you type the formula.
  • When a referenced cell changes, the result updates by itself.

Functions

FunctionWhat it doesExample
SUMAdds a range=SUM(E2:E8)
AVERAGEThe average of a range=AVERAGE(E2:E8)
MIN and MAXThe smallest and largest value=MAX(E2:E8)
COUNT and COUNTACounts cells with numbers; counts cells that are not empty=COUNTA(A2:A8)
IFOne result if a test is true, another if not=IF(E2>300,"Over","OK")
COUNTIFCounts cells that match a condition=COUNTIF(F2:F8,"Over")
Functions you will use every week
  • Insert › Function, or Functions (Σ) on the toolbar, starts a function for you.
  • As you type =SU, Sheets suggests matching functions and shows a help box with what each part means.
  • Select a range of numbers and look at the bottom right: Sheets shows their sum without a formula.
  • If you know Excel: these functions, and many more such as VLOOKUP and XLOOKUP, work the same way.
Drag and drop: match

Which function?

Match each question to the function that answers it.

Drag each card into place, or tap a card and then tap where it goes.

What did all the repairs cost together?
Drop the matching card here
What does a typical repair cost?
Drop the matching card here
What was the most expensive repair?
Drop the matching card here
Was this repair over the limit?
Drop the matching card here
How many repairs went over the limit?
Drop the matching card here
Place every card to check.

Copying formulas: relative and absolute references

  • Click the cell with the formula and drag the small blue square at its bottom right corner (the fill handle) down the column. Or select the cell and the cells below and press Ctrl+D.
  • References change as the formula is copied: =C2+D2 in row 2 becomes =C3+D3 in row 3. These are relative references.
  • To keep a reference from changing, add dollar signs: $H$2 always points to H2. Press F4 while typing a reference to add them.
Worked example

Flagging repairs over the limit

The $300 limit is in H2. Flag each repair in column F.

  1. 1

    In F2, type =IF(E2>$H$2,"Over","OK").

    E2 should change row by row, but every row must compare with the same limit in H2.

  2. 2

    Fill F2 down to F8.

    Each row gets its own test: E3, E4, and so on, always against $H$2.

  3. 3

    In F10, type =COUNTIF(F2:F8,"Over").

    Denise wants one number: how many went over.

Result: Every repair is flagged, and the count updates when Kim changes a cost or Denise changes the limit.

Key takeaway: Put values that may change, like a limit or a tax rate, in their own cell and point to it with $.

Knowledge Check

Check your understanding

You copy =C2+D2 from E2 down to E3. What is the formula in E3?

Check your understanding

Every row must compare its total with the limit in H2. Which reference do you use for the limit?

Practice Simulation

Practice what this lesson taught in a working copy of the app. Tasks appear under the window, just like GMetrix.

Practice simulation

Let the repair cost sheet do the math

Kim tracks the parts and labor cost of every repair. Add the totals, the monthly summary, and a flag on any repair over Parkview's limit in H2, so nobody needs a calculator.

Loading the simulation...

Challenge

Apply what you've learned in this lesson.

Add formulas to the Budget Practice sheet from the last lesson (or make a new list of five costs).

  1. Below the costs, use SUM for the total, AVERAGE for the average, and MAX for the highest cost.
  2. Type a spending limit in a cell to the right, such as 50.
  3. In a new column, use IF with an absolute reference to the limit to show Over or OK, and fill it down.
  4. Use COUNTIF to count how many items are Over.
Deliverable: Share the spreadsheet with your instructor as a Viewer, or submit a screenshot showing the formula bar for your IF formula. No Google account? Complete the practice simulation and submit its results page.

Finished this lesson?

Progress is saved in this browser only. It is not a grade — official progress lives in Brightspace.