Sub topic 11
Open-Ended Ranges for Growing Data
Why use an open-ended range?
An open-ended range includes a starting cell and continues to the end of a row or column. For example, B2:B means every cell in column B from row 2 downward.
This is useful when new records will be added later. A formula using B2:B already includes those future rows. You do not need to edit the formula each time the data grows.
This chapter assumes that you can open a spreadsheet, enter values, and use basic operators such as +, -, *, and /.
=SUM(B2:B)This formula adds the values in column B from row 2 onward. If you enter a new number in B11, the result includes it automatically.
A closed range has a fixed ending row:
=SUM(B2:B10)A closed range stops at row 10. An open-ended range has no specified final row:
=SUM(B2:B)Keep headers out of the range
If row 1 contains a header such as Amount, start the range at row 2. Including the header can cause an error in some functions or make the formula less clear.
| Range | Meaning |
|---|---|
| `B:B` | The entire B column, including the header |
| `B2:B` | Column B from row 2 downward |
| `B2:B100` | Rows 2 through 100 only |
Use the narrowest starting point that matches your data. An open-ended range can process many empty cells, so using B2:B across numerous complex formulas may make a large spreadsheet slower.
Open-ended ranges with conditions
Open-ended ranges work with functions that inspect values. For example, this formula counts nonblank entries in column A:
=COUNTA(A2:A)This formula adds sales amounts in column C only when the category in column B is Paid:
=SUMIF(B2:B,"Paid",C2:C)The two ranges should cover compatible rows. In this example, B2 corresponds to C2, B3 corresponds to C3, and so on.
Common errors
An open-ended range does not solve every reference problem.
#REF!usually means that a referenced cell, row, or sheet was deleted or moved in a way that broke the formula.#NAME?can appear when a function name or named range is misspelled. Check the spelling and punctuation.#DIV/0!occurs when a formula divides by an empty cell or zero. An open-ended range may include blank rows, so protect division with a condition.
For example, this formula avoids division when B2 is zero or empty:
=IF(OR(B2=0,B2=""),"",C2/B2)Choosing between open-ended and closed ranges
Use an open-ended range when rows are added regularly and the formula should include them automatically. Use a closed range when you need a strict boundary, such as a report covering only a specified period.
Exercise
Column D contains amounts, with a header in D1. Write a formula that adds all current and future amounts without including the header.
Show answer
=SUM(D2:D)