Sub topic 1
Cells and ranges: what you pass to a function
Prerequisites
This chapter assumes you can enter values and formulas in a Google Sheets spreadsheet. You should also be able to read cell addresses such as B2, where the letter is the column and the number is the row.
Cells and ranges: what you pass to a function
A cell address names one cell. A range names a block of cells, written as the first cell, a colon, and the last cell. The range B2:B6 covers B2, B3, B4, B5, and B6. Aggregate functions accept ranges as input, so one formula can process many values at once.
How a function call is written
Every function call has the same shape: a function name, an opening parenthesis, arguments separated by commas, and a closing parenthesis. Arguments can be ranges, single cell addresses, or literal numbers.
=FUNCTION_NAME(argument1, argument2, ...)Adding values with SUM
SUM adds every numeric value in its arguments. It skips text and blank cells.
=SUM(B2:B6)You can pass several arguments in one call. This formula adds two ranges and a literal number:
=SUM(B2:B6, D2:D6, 100)Finding the mean with AVERAGE
AVERAGE returns the sum of the numeric values divided by the count of those values. It does not divide by the number of rows in the range.
=AVERAGE(B2:B6)Exercise
Cells B2 through B6 contain 10, 20, a blank cell, 40, and 50. What does =AVERAGE(B2:B6) return?
Show answer
30. AVERAGE skips the blank cell, so it adds 10, 20, 40, and 50 to get 120, then divides by the four numbers to get 30.