Lesson 1: The Sheets screen, files and importing
Google Sheets is an online spreadsheet app. It runs in a web browser, and there are also apps for Android and iPhone. A Sheets file is called a spreadsheet. Each spreadsheet has one or more sheets, shown as tabs at the bottom of the screen.
Creating and saving a spreadsheet
- Go to sheets.google.com and click Create (the plus icon), or go straight to sheets.google.com/create.
- A new file is called Untitled spreadsheet. To rename it, click the name at the top, type a new name and press Enter.
- There is no save button. Google saves your changes automatically as you type when you are online. In Sheets, click outside the cell you typed in.
- File > Make a copy makes a copy of the whole file. File > Download saves a copy on your computer in another file type.
Google Drive lists a size limit of up to 20 million cells or 100 MB for a spreadsheet created in or converted to Sheets.
Cells, ranges and sheets
Columns have letters (A, B, C…) and rows have numbers (1, 2, 3…). A cell's name is its column letter and then its row number: column D, row 7 is D7. A range is a block of cells written as first cell, colon, last cell. To count the cells, multiply the columns by the rows: A2:D6 is 4 columns × 5 rows = 20 cells.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Code | Onderdeel | Price | Stock |
| 2 | K100 | Keyboard | 34.99 | 12 |
| 3 | M220 | Mouse | 18.50 | 40 |
| 4 | H310 | Headset | 59.00 | 7 |
| 5 | C415 | USB cable | 9.25 | 65 |
| 6 | W520 | Webcam | 72.00 | 0 |
- Add sheet (+) at the bottom adds another tab to the same file. The Create button on the home screen makes a new file instead.
- To add a row, right-click a row number and choose an option such as Insert 1 row above. Right-click and choose Delete row to remove one.
- To keep headings on screen while you scroll, select View > Freeze and choose how many rows or columns. Choose No rows to unfreeze.
- View > Group groups rows or columns so you can collapse them.
Using data from other sheets and files
A formula can use a cell on another sheet in the same file. Type the sheet name, an exclamation point (!) and the cell, for example =Sheet1!A1. If the sheet name has spaces or symbols, put it in single quotes: ='Week two'!B4. To use cells from a different spreadsheet file, you must use the IMPORTRANGE function.
Importing a CSV or Excel file
A CSV file is plain text with values separated by commas. Many systems (payroll, point of sale, scheduling) export CSV files. To bring one into an open spreadsheet, select File > Import and choose the file. Sheets imports .csv, .tsv, .txt, .tab, .xlsx, .xls, .ods and some other types, but not password-protected files. Then pick an import location:
| Import location | What it does |
|---|---|
| Create new spreadsheet | Opens the data as a new file in a new tab |
| Insert new sheets | Adds the data as new tabs in this file |
| Replace spreadsheet | Replaces the whole open file with the imported data |
| Replace current sheet | Replaces what is on the current sheet |
| Append rows to current sheet | Adds the data after the last row that has data |
| Replace data starting at selected cell | Writes over cells starting at the cell you selected |
For text files, choose a Separator character: Detect automatically (it can also find semicolons and fixed-width files), Tab, Comma or Custom. Then click Import.
To work on an Excel file as a Google Sheets file, upload it in Drive (New > File upload), then right-click it and select Open with > Google Sheets. Microsoft files stored in Drive can also be updated without converting them.
Lesson 2: Entering and formatting data
Typing and editing
Click an empty cell and type, then press Enter. To change a cell that already has content, double-click it. Useful shortcuts on a Windows PC or Chromebook:
| Shortcut | What it does |
|---|---|
| Ctrl+; | Insert today's date |
| Ctrl+Shift+; | Insert the time |
| Ctrl+Z / Ctrl+Y | Undo / redo |
| Ctrl+Shift+V | Paste values only (no formatting or formulas) |
| Ctrl+F | Find |
| Ctrl+H | Find and replace |
| Ctrl+\ | Clear formatting |
| Ctrl+/ | Show common keyboard shortcuts |
Number formats
A number format changes how a value looks. Select the cells, then Format > Number, and pick a format. The toolbar also has buttons for currency, percent and decimal places. Shortcuts: Ctrl+Shift+4 currency, Ctrl+Shift+5 percent, Ctrl+Shift+3 date, Ctrl+Shift+1 decimal.
A percent format shows the value times 100: 0.25 shows as 25%. The value stored in the cell is still 0.25, and formulas use that value.
Custom number formats
Format > Number > Custom number format lets you build your own. Common symbols:
| Symbol | Meaning | Example |
|---|---|---|
| 0 | A digit; extra zeros are shown | Format 0000 shows 457 as 0457 |
| # | A digit; extra zeros are not shown | Format #,##0.00 shows 1234.5 as 1,234.50 |
| , | Thousands separator | 1234567 with #,##0 shows 1,234,567 |
| % | Shows the number as a percent | 0% shows 0.25 as 25% |
| [Red] | Colours that part of the format | 0.00;[Red]-0.00 shows -12 as -12.00 in red |
A custom format can have up to four parts, separated by semicolons, in this order: positive; negative; zero; text (non-numeric). So in 0.00;[Red]-0.00, the second part sets how negative numbers look.
Layout
- Wrap text: the toolbar option that changes how text wraps keeps long notes inside the cell on several lines.
- Merge cells: select cells such as A1:F1, then Format > Merge cells, to make one wide title cell.
- Column width: double-click the edge of a column letter to fit the data, or right-click the letter, choose Resize column and pick Fit to data.
- Copy formatting: the paint format button copies formatting from one place to another.
Autofill a series
Type values in at least two cells next to each other and select them. A small blue box appears in the lower-right corner. Drag it down or across. If the cells form a series of numbers or dates, the series continues: 5 and 10 become 15, 20, 25. If they don't form a series, the values repeat: Day, Night becomes Day, Night, Day, Night.
| A | B | |
|---|---|---|
| 1 | Step | Shift |
| 2 | 5 | Day |
| 3 | 10 | Night |
| 4 | 15 | Day |
| 5 | 20 | Night |
| 6 | 25 | Day |
Lesson 3: Formulas, functions and references
A formula always starts with an equal sign (=). As you type a function name, Sheets shows a function help box with the function's definition, syntax and an example, and it may suggest formulas and ranges. Cells used in a formula are highlighted in colour.
| Operator | Meaning | Example |
|---|---|---|
| + | Add | =B2+C2 |
| - | Subtract | =B2-C2 |
| * | Multiply | =B2*C2 |
| / | Divide | =B2/C2 |
| & | Join text | =A2&" "&B2 gives Priya Shah |
You can put a function inside another one. Sheets works out the innermost function first: in =ABS(SUM(A1:A7)), SUM runs first and ABS uses its result.
Basic functions
| Function | What it returns | Good to know |
|---|---|---|
| SUM(value1, [value2, …]) | The total | =SUM(B2:B5) or =SUM(1,2,A2:A50) |
| AVERAGE(…) | The mean: sum ÷ number of values | Text is ignored; a 0 is a value and counts |
| COUNT(…) | How many numeric values | Text and empty cells are not counted |
| COUNTA(…) | How many values of any kind | Counts text and numbers; empty cells are not values |
| MIN(…) / MAX(…) | The smallest / largest number | Cells without numbers are ignored |
| ROUND(value, [places]) | A rounded number | places is 0 if left out; 5 or more rounds up |
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Staff | Mon | Tue | Wed | Thu | Fri |
| 2 | Priya | 8 | 8 | 6 | 0 | 7.5 |
| 3 | Marco | 7 | 7.5 | 8 | 8 | |
| 4 | Lena | 6.5 | 7 | 7 | 7 | 6 |
| 5 | Tom | 4 | 5 | 8 | 8 |
ROUND
=ROUND(15.567,2) gives 15.57: Sheets looks at the next digit (7), and 5 or more rounds up. =ROUND(2.5) gives 3, because places is 0 when left out. A negative places value rounds to the left of the decimal point: =ROUND(1874.6,-2) gives 1900 (the nearest hundred).
Relative and absolute references
A normal reference such as G2 is relative: when you copy the formula down 2 rows, G2 becomes G4. Add dollar signs to make it absolute so it does not shift: $J$1 always points to J1. While you type a formula, press F4 to switch a reference between absolute and relative. So if H2 holds =G2*$J$1 and you copy it to H4, H4 holds =G4*$J$1.
Other helpful shortcuts: Ctrl+D fills down, Ctrl+R fills right, and Ctrl+~ shows all formulas instead of their results.
Practical exercise: total a weekly shift schedule
Copy this schedule into a new spreadsheet. Marco's Tuesday and Tom's Wednesday are days off, so those cells are empty.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Staff | Mon | Tue | Wed | Thu | Fri | Total |
| 2 | Priya | 8 | 8 | 6 | 0 | 7.5 | |
| 3 | Marco | 7 | 7.5 | 8 | 8 | ||
| 4 | Lena | 6.5 | 7 | 7 | 7 | 6 | |
| 5 | Tom | 4 | 5 | 8 | 8 | ||
| 6 | Daily total |
In G2, total Priya's hours for the week. Then fill the formula down to G5.
Toon antwoord
=SUM(B2:F2) returns 29.5. Filled down: Marco 30.5, Lena 33.5, Tom 25.
In B6, total the hours for Monday. Then fill right to F6.
Toon antwoord
=SUM(B2:B5) returns 25.5. Tue 20, Wed 20.5, Thu 23, Fri 29.5.
Write one formula for the total hours of the whole team.
Toon antwoord
=SUM(B2:F5) returns 118.5. =SUM(G2:G5) gives the same answer.
How many shifts did Tom work? Use a function, not your eyes.
Toon antwoord
=COUNT(B5:F5) returns 4. COUNT counts only the cells with numbers, so his empty Wednesday is skipped.
Who has the longest single shift, and how long is it?
Toon antwoord
=MAX(B2:F5) returns 8. Priya, Marco and Tom each have 8-hour shifts.
Practical exercise: build an invoice with GST
Build this office-supplies invoice. The GST rate is in D8 as 0.05 (5%). This is an example only: rates differ by province and territory, such as 5% GST in Alberta and 13% HST in Ontario.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Onderdeel | Qty | Unit price | Line total |
| 2 | Copy paper (box) | 4 | 38.75 | |
| 3 | Ink cartridge | 3 | 27.49 | |
| 4 | File folders (pack) | 5 | 6.80 | |
| 5 | Desk organizer | 2 | 19.95 | |
| 6 | ||||
| 7 | Subtotal | |||
| 8 | GST rate | 0.05 | ||
| 9 | GST | |||
| 10 | Total |
In D2, calculate the line total for the copy paper, then fill down to D5.
Toon antwoord
=B2*C2. The line totals are 155.00, 82.47, 34.00 and 39.90.
In D7, calculate the subtotal.
Toon antwoord
=SUM(D2:D5) returns 311.37.
In D9, calculate the GST rounded to the cent.
Toon antwoord
=ROUND(D7*D8,2) returns 15.57. Without ROUND the result is 15.5685.
In D10, calculate the total.
Toon antwoord
=D7+D9 returns 326.94.
You put =D2*D8 in E2 to show GST for each line and fill it down. Why are E3 to E5 wrong, and how do you fix it?
Toon antwoord
D8 is relative, so E3 becomes =D3*D9, which is the wrong cell. Use =D2*$D$8 so every row uses the rate in D8.
Lesson 4: IF, COUNTIF and lookups
IF
=IF(logical_expression, value_if_true, value_if_false) checks a test and returns one of two values. Put text in double quotes. Google says that mixing up the order of the two values is the most common mistake with IF.
- =IF(C3>=D3,"OK","Reorder"): if the quantity is at least the reorder level, show OK; otherwise show Reorder.
- A nested IF puts a second IF in the false part: =IF(B2>=8,"Full",IF(B2>=4,"Part","Off")). If B2 is 6, the first test is FALSE, the second is TRUE, and the result is Part.
- IFS checks several conditions and returns the value for the first true one.
COUNTIF and SUMIF
=COUNTIF(range, criterion) counts the cells that match. =SUMIF(range, criterion, [sum_range]) adds the matching rows of sum_range. Text criteria go in quotes.
- Text: =COUNTIF(B2:F6,"A"). COUNTIF is not case sensitive, so "P" also matches a small p.
- Comparisons: put the operator in quotes, for example ">20", ">=10" or "<5".
- Wildcards: ? matches one character and \* matches any number of characters. "\*tape\*" matches any text containing tape. Put ~ in front to match a real ? or *.
- COUNTIF takes one condition. For several conditions, use COUNTIFS.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Onderdeel | Category | Qty | Reorder at |
| 2 | Nitrile gloves | PPE | 120 | 50 |
| 3 | Safety glasses | PPE | 18 | 20 |
| 4 | Box cutters | Tools | 9 | 10 |
| 5 | Packing tape | Supplies | 64 | 24 |
| 6 | Hi-vis vests | PPE | 30 | 15 |
| 7 | Label rolls | Supplies | 6 | 12 |
| 8 | Tape guns | Tools | 14 | 5 |
IFERROR
=IFERROR(value, [value_if_error]) returns the value if it is not an error, and otherwise the second argument (blank if you leave it out). =IFERROR(B2/C2,0) shows 0 instead of an error when C2 is empty.
VLOOKUP
=VLOOKUP(search_key, range, index, [is_sorted]) searches down the first column of the range and returns a value from the same row.
- index counts the columns of the range from 1: in A2:D6 below, 3 is Price and 4 is Stock.
- is_sorted: use FALSE for an exact match (Google recommends it). If you leave it out, the default is TRUE, an approximate match that needs a sorted first column and can return a wrong row.
- If an exact match is not found, VLOOKUP returns #N/A. Wrap it in IFNA() to show something else.
- The search key must be in the first column. =VLOOKUP("Mouse",A2:D6,3,FALSE) returns #N/A because Mouse is in column B.
- Spaces matter: "Mouse" and "Mouse " are different. VLOOKUP returns only the first match.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Code | Onderdeel | Price | Stock |
| 2 | K100 | Keyboard | 34.99 | 12 |
| 3 | M220 | Mouse | 18.50 | 40 |
| 4 | H310 | Headset | 59.00 | 7 |
| 5 | C415 | USB cable | 9.25 | 65 |
| 6 | W520 | Webcam | 72.00 | 0 |
XLOOKUP
Google Sheets also has XLOOKUP: =XLOOKUP(search_key, lookup_range, result_range, [missing_value], [match_mode], [search_mode]). You name the result column directly, so you don't count columns, and the result can be to the left of the search column: =XLOOKUP("Webcam",B2:B6,A2:A6) returns W520.
- missing_value is returned if there is no match; the default is #N/A. =XLOOKUP("Z999",A2:A6,C2:C6,"Not found") returns Not found.
- match_mode defaults to 0, an exact match. 2 is a wildcard match.
- search_mode defaults to 1 (first to last); -1 searches from last to first.
- lookup_range must be a single row or column.
Practical exercise: count attendance and flag absences
Copy this attendance sheet. P means present, A means absent and L means late. Dev's Thursday was typed with a small p.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Name | Mon | Tue | Wed | Thu | Fri | Absent | Flag |
| 2 | Arjun | P | P | A | P | P | ||
| 3 | Bea | P | L | P | P | A | ||
| 4 | Chloe | A | A | P | P | P | ||
| 5 | Dev | P | P | P | p | P | ||
| 6 | Elif | P | P | L | A | P |
In G2, count Arjun's absences and fill down to G6.
Toon antwoord
=COUNTIF(B2:F2,"A") returns 1 for Arjun. Bea 1, Chloe 2, Dev 0, Elif 1.
Count all the late arrivals for the week in one formula.
Toon antwoord
=COUNTIF(B2:F6,"L") returns 2 (Bea on Tuesday and Elif on Wednesday).
Does Dev's small p count as present?
Toon antwoord
Yes. COUNTIF is not case sensitive, so =COUNTIF(B5:F5,"P") returns 5.
In H2, show "Follow up" if the person has 2 or more absences and nothing otherwise. Fill down.
Toon antwoord
=IF(G2>=2,"Follow up",""). Only Chloe (2 absences) shows Follow up.
Lesson 5: Sorting, filtering, validation and highlighting
Sorting
- Select the cells to sort, including all the columns, so rows stay together.
- Select Data > Sort range > Advanced range sorting options.
- If row 1 has headings, tick Data has header row.
- Choose the column and the order (A to Z or Z to A). Click Add another sort column for a second rule.
- Click Sort.
To sort a whole sheet, right-click the column letter and click Sort sheet A to Z or Sort sheet Z to A. Note that sorting does not change formulas that point into the range: =B2 still points to B2.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Onderdeel | Category | Qty | Reorder at |
| 2 | Nitrile gloves | PPE | 120 | 50 |
| 3 | Safety glasses | PPE | 18 | 20 |
| 4 | Box cutters | Tools | 9 | 10 |
| 5 | Packing tape | Supplies | 64 | 24 |
| 6 | Hi-vis vests | PPE | 30 | 15 |
| 7 | Label rolls | Supplies | 6 | 12 |
| 8 | Tape guns | Tools | 14 | 5 |
Filters and filter views
Select the range and choose Data > Create a filter. Click the Filter icon in a heading to filter by values (untick what to hide), filter by condition, search, or filter by colour. Rows that don't match are hidden, not deleted. Choose Data > Remove filter to turn it off.
| Filter | Filter view | |
|---|---|---|
| Who sees it | Everyone with access to the file | Only the person using it |
| Who can change it | People with edit access | Each person has their own |
| How to make it | Data > Create a filter | Data > Create filter view |
If you only have view access, you can still create a filter view, but it is temporary, only you can use it, and it isn't saved.
Dropdowns and checkboxes (data validation)
- Add a dropdown with Insert > Dropdown, by right-clicking a cell, or with Data > Data validation > Add rule.
- Dropdown lets you type the items. Dropdown from a range takes the items from cells, such as Lists!A2:A8.
- By default, an entry that is not in the list is rejected. Under Advanced options, choose Show a warning to allow it.
- Insert a checkbox with Insert > Checkbox. To store other values (such as Yes and No), use Data > Data validation, set the criteria to Checkbox and click Use custom cell values.
Conditional formatting
Select the cells, then Format > Conditional formatting. Under Format cells if, choose a condition (such as Less than or Text contains) and a formatting style. Color scale shades cells from a minimum to a maximum value.
For more control, choose Custom formula is. Use $ to lock the column, so the whole row follows one column: applied to A2:D8, =$C2<$D2 highlights each row where Qty is below Reorder at. =COUNTIF($A$1:$A$100,A1)>1 highlights duplicates. If two rules are true, the first rule found to be true decides the format; drag rules to change the order.
Protecting ranges
Data > Protect sheets and ranges can show a warning before someone edits, or restrict who can edit. Google says protection shouldn't be used as a security measure: people can still print, copy, paste, import and export. Share only with people you trust.
Practical exercise: manage a supply-room inventory
Copy this inventory into a new spreadsheet. Each item should be reordered when Qty drops below Reorder at.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Onderdeel | Category | Qty | Reorder at |
| 2 | Nitrile gloves | PPE | 120 | 50 |
| 3 | Safety glasses | PPE | 18 | 20 |
| 4 | Box cutters | Tools | 9 | 10 |
| 5 | Packing tape | Supplies | 64 | 24 |
| 6 | Hi-vis vests | PPE | 30 | 15 |
| 7 | Label rolls | Supplies | 6 | 12 |
| 8 | Tape guns | Tools | 14 | 5 |
Highlight every row that needs a reorder. What rule do you use, and how many rows turn colour?
Toon antwoord
Select A2:D8, then Format > Conditional formatting > Custom formula is =$C2<$D2. Three rows: Safety glasses, Box cutters and Label rolls.
Filter Category to show only PPE. How many rows are visible?
Toon antwoord
3: Nitrile gloves, Safety glasses and Hi-vis vests.
Remove the filter, then sort by Qty from largest to smallest. Which item is first?
Toon antwoord
Nitrile gloves (120). Tick Data has header row so the headings stay in row 1.
Make the Category column a dropdown with PPE, Tools and Supplies. Which criteria do you use?
Toon antwoord
Insert > Dropdown (or Data > Data validation > Add rule), criteria Dropdown, with the three items. Entries not in the list are rejected by default.
What is the total quantity of PPE items?
Toon antwoord
=SUMIF(B2:B8,"PPE",C2:C8) returns 168.
Themaquiz 5: Sorting, filtering, validation and highlighting
Bronnen
- Google Docs Editors Help: Create and use functions in Google Sheets
- Google Docs Editors Help: Create, view or download a file
- Google Docs Editors Help: How to use Google Sheets
- Google Workspace Learning Center: Create your first spreadsheet
- Google Workspace Learning Center: Share and collaborate on a spreadsheet
- Google Workspace Learning Center: Google Sheets cheat sheet
- Google Drive Help: Files you can store in Google Drive (size limits)
- Google Docs Editors Help: Reference data from other sheets
- Google Docs Editors Help: Import data sets into Google Sheets
- Google Docs Editors Help: Add, move or delete rows, columns and cells
- Google Docs Editors Help: Freeze or merge rows and columns
- Google Docs Editors Help: Format numbers in a spreadsheet
- Google Docs Editors Help: Use autofill to complete a series
- Google Docs Editors Help: Keyboard shortcuts for Google Sheets
- Google Docs Editors Help: Google Sheets function list
- Google Docs Editors Help: SUM function
- Google Docs Editors Help: AVERAGE function
- Google Docs Editors Help: COUNT function
- Google Docs Editors Help: COUNTA function
- Google Docs Editors Help: MIN function
- Google Docs Editors Help: MAX function
- Google Docs Editors Help: ROUND function
- Google Docs Editors Help: IF function
- Google Docs Editors Help: COUNTIF function
- Google Docs Editors Help: SUMIF function
- Google Docs Editors Help: IFERROR function
- Google Docs Editors Help: VLOOKUP function
- Google Docs Editors Help: XLOOKUP function
- Google Docs Editors Help: Sort and filter your data
- Google Docs Editors Help: Create an in-cell dropdown list
- Google Docs Editors Help: Add and use checkboxes
- Google Docs Editors Help: Use conditional formatting rules in Google Sheets
- Google Docs Editors Help: Protect, hide and edit sheets
- Google Docs Editors Help: Add and edit a chart or graph
- Google Docs Editors Help: Types of charts and graphs in Google Sheets
- Google Drive Help: Share files from Google Drive
- Google Docs Editors Help: Use comments, action items and reactions
- Google Docs Editors Help: Find what's changed in a file (version history)
- Canada Revenue Agency: GST/HST calculator (and rates)