Sub topic 10
Using Whole-Column References
Prerequisites
This chapter assumes you can enter formulas in Google Sheets and read cell addresses such as B2. You should also know that a range is a group of cells, such as B2:B100.
A whole-column reference names an entire column instead of a fixed range. For example, B:B refers to every cell in column B.
Why use a whole-column reference?
Suppose column B contains sales amounts. This formula adds every numeric value in that column:
=SUM(B:B)The formula includes values added in future rows. You do not need to change the ending row each time new data arrives.
A whole-column reference also works with other aggregate functions:
=AVERAGE(B:B)
=COUNT(B:B)
=MIN(B:B)
=MAX(B:B)Text, headers, and blank cells do not become numeric values simply because the reference includes the whole column. The functions apply their normal rules to the cells they find.
Avoiding circular references
A circular reference occurs when a formula directly or indirectly depends on its own result. For example, placing this formula in any cell in column B creates a circular reference:
=SUM(B:B)The formula tries to include itself in the sum. Google Sheets reports an error instead of producing a reliable total.
Place the total in another column, such as D1, if you want to use B:B:
=SUM(B:B)You can also use a bounded range that stops before the total row:
=SUM(B2:B100)However, this second approach does not include data entered below row 100.
Choosing a reference style
| Reference | Includes new rows automatically? | Main risk |
|---|---|---|
| `B2:B100` | No | Later data falls outside the range |
| `B2:B` | Yes | A total placed in column B can be included |
| `B:B` | Yes | The header and any formula in column B are included |
B2:B is an open-ended range. It starts at row 2 and continues to the bottom of the sheet. It is often useful when row 1 contains a header:
=SUM(B2:B)This still creates a circular reference if the formula is placed somewhere in column B. Put the formula in another column or use a fixed ending row.
Whole-column references are convenient for small or moderate sheets with a consistent layout. For very large workbooks, a bounded range can make the intended data easier to inspect and can avoid accidentally including notes, subtotals, or unrelated values far below the table.
Exercise
Exercise
Column B contains a header in B1 and sales values from B2 downward. You want a total in D1 that includes sales entered later. Which formula should you use, and why?
Show answer
Use =SUM(B2:B). It excludes the header, includes current and future rows, and does not create a circular reference because the formula is in column D.