Sub topic 11
Open-ended ranges for growing data
This chapter assumes you can write formulas that start with =, read A1 notation, and use ranges such as B2:B10. It also assumes you know the difference between relative and absolute references. The goal here is to write formulas that keep working as rows are added below your data.
The problem with fixed ranges
A fixed range such as B2:B10 covers exactly nine cells. If you type a new value in B11, =SUM(B2:B10) ignores it. You then have to edit the formula, and it is easy to forget.
Google Sheets softens this in one case. If you insert a row inside the range, for example between rows 5 and 6, the range grows to B2:B11. Typing below the last row does not extend it, because that is outside the range.
An open-ended range removes the problem by leaving off the row number for the end of the range.
Writing an open-ended range
Write the column letter at the end of the range without a row number:
=SUM(B2:B)This reads "from B2 down to the bottom of column B". Every row of the column from row 2 onward counts, including rows you add later. The header in B1 is left out because the range starts at row 2.
You can also open a range on both sides:
B:Bis the whole of column B, including the header.B2:Bstarts at row 2 and runs to the last row of the sheet.B2:Dcovers columns B to D, from row 2 down.2:2is the whole of row 2. Rows can be left open to the right in the same way, for exampleB2:2.
The sheet's last row is whatever the sheet currently has, not a fixed number. If you add rows to the sheet, the range covers them as well.
Worked example: a running total that grows
Suppose a sheet records orders. Column A holds the order date, column B the quantity, and column C the unit price. Row 1 has headers.
| A | B | C |
|---|---|---|
| Date | Quantity | Unit price |
| 2026-11-01 | 3 | 12 |
| 2026-11-02 | 5 | 12 |
| 2026-11-03 | 2 | 15 |
Put these summaries in column F:
=SUM(B2:B)
=COUNT(B2:B)
=AVERAGE(B2:B)
=MAX(A2:A)With the three data rows above, the results are 10, 3, about 3.33, and 2026-11-03 (formatted as a date). When someone adds a fourth order in row 5, all four formulas update without any edit.
Notice that each formula starts at row 2. This keeps the header text out of the calculation. Most summary functions ignore text, but some do not. For example, COUNTA(B:B) counts the header as a value, so it returns one more than the number of orders.
Keeping summaries off the data column
An open-ended range includes everything below its start. If you put the total in the same column, you create a circular reference:
=SUM(B2:B)typed into B20 includes B20 itself. Sheets reports a circular dependency error and the cell does not calculate. The same happens if the formula sits anywhere in the range.
There are three ways to avoid this:
- Put summary formulas in a column that the range does not cover, such as column F in the example above.
- Put them above the data, for example in rows 1 to 3, and start the data lower down.
- Put them on a separate sheet and refer to the data sheet by name.
The third option works well for dashboards. It uses a cross-sheet reference with an open end:
=SUM('Sales Data'!B2:B)Open ends and blank cells
An open-ended range includes thousands of empty cells below your data. Most aggregate functions skip blanks, so this is harmless for SUM, AVERAGE, MIN, MAX, and COUNT. Some functions behave differently.
| Formula | What it does with blanks |
|---|---|
| `=SUM(B2:B)` | Ignores them |
| `=AVERAGE(B2:B)` | Ignores them, so the average covers only filled cells |
| `=COUNT(B2:B)` | Counts numbers only |
| `=COUNTA(B2:B)` | Counts non-empty cells only |
| `=COUNTBLANK(B2:B)` | Counts every empty cell down to the sheet's last row, so the result is large and changes when rows are added to the sheet |
A cell that looks empty may not be. A formula that returns "" is not blank for COUNTA, and a cell with a single space counts as text. If your count is higher than expected, check for these.
Open-ended ranges inside other functions
Open-ended ranges work wherever a normal range works. Three common uses:
=SUMIF(A2:A,"Shipped",B2:B)
=COUNTIF(A2:A,">=2026-11-01")
=VLOOKUP("Widget",A2:C,3,FALSE)In SUMIF, the criteria range and the sum range should have the same size. Using A2:A with B2:B keeps them matched. Mixing A2:A with B2:B20 can give an unexpected result or an error, so use the same style for both.
You can combine an open end with absolute markers when you plan to fill the formula to other cells:
=SUMIF($A$2:$A,E2,$B$2:$B)Here E2 changes as you fill down, and the lookup columns stay fixed. The $ before the column letter and the row number locks those parts. The open end has no row number to lock, so $A$2:$A is the usual form.
When the range needs to be bounded
Sometimes the open end causes trouble. A few cases to watch for:
- Other content below the data. If a note or a second table sits lower in the same column, the range includes it. Keep unrelated content out of the column, or give it its own sheet.
- Slower sheets. Very large open ranges inside heavy functions such as
ARRAYFORMULAorQUERYcan slow recalculation, because Sheets scans every row up to the sheet's end. Deleting unused rows from the bottom of the sheet helps. - Header rows that change. If you insert a new row above the first data row,
B2:Bmoves toB3:B, and the new row 2 is no longer included when you insert above the start of the range. When you insert a row at row 2, the range shifts down with the old row 2. Check the formula after such edits.
Choosing between open-ended and fixed ranges
| Situation | Better choice |
|---|---|
| Data is appended over time, such as a log or order list | Open-ended, `B2:B` |
| Data has a known, stable size, such as 12 months | Fixed, `B2:B13` |
| Totals are placed in the same column as the data | Fixed, so the total is outside the range |
| Other content sits below the data in the same column | Fixed, or move the other content |
| Formula is used with `ARRAYFORMULA` to fill a column | Open-ended, with a blank check |
A preview of ARRAYFORMULA
Open-ended ranges also let one formula calculate a whole column. The next chapter covers this fully, but this is the pattern:
=ARRAYFORMULA(IF(B2:B="","",B2:B*C2:C))Put this in D2 and it multiplies B and C for every row. The IF(B2:B="","", ...) part leaves the result blank where B is empty, so the open end does not fill the column with zeros. Without it, rows with no quantity would show 0.
For this to work, the cells below D2 in column D must be empty. If any of them contains a value, the formula shows #REF! with a message that the array result was not expanded.
Common errors
- Circular dependency: the formula sits inside its own range. Move it outside the range.
#REF!from ARRAYFORMULA: a cell in the output area is not empty. Clear it.- Total is too high by one row: the range starts at the header, or at the total row itself. Start at the first data row.
COUNTBLANKis huge: the open end counts empty cells to the bottom of the sheet. Use a bounded range for this function.- Mismatched sizes in
SUMIF: one range is open-ended and the other is fixed. Use the same style for both.
Summary
An open-ended range such as B2:B starts at a fixed cell and runs to the bottom of the column, so new rows are counted without editing the formula. Start below the header, keep totals outside the range, and use the same range style for paired arguments. Use a bounded range for functions that count blanks or when other content shares the column.
Exercise
A sheet has headers in row 1 and order quantities in B2 down. Someone types =SUM(B2:B) into cell B30 to show a total below the data. What happens, and how would you fix it?
Show answer
The formula sits inside its own range, so it creates a circular dependency and does not calculate. Move the total to a cell outside column B rows 2 and below, such as F1 or a cell above the data, or change the range to a fixed one that ends above the total, for example =SUM(B2:B29).
Exercise
You use =SUMIF(A2:A,"Shipped",B2:B20). Why is this a risk as the data grows, and what is the corrected formula?
Show answer
The criteria range is open-ended but the sum range stops at row 20, so the two ranges have different sizes. Rows past 20 may be ignored or cause an error. Use =SUMIF(A2:A,"Shipped",B2:B) so both ranges match.