Cell ranges
A1:D20, usually named, are a pretty strong tool in Excell. They are in fact, little database tables. And many times, they ain't so little. One issue with them is that it can be pretty easy to booger them up. Usually it is two common maneuvers that boogers them...
- Inserting a new row at the first row in the range.
- Deleting the first or last row in the range.
The trouble is those are the places where inserting and deleting commonly take place. Here's a couple hints for avoiding busted tables, or cell ranges, or the functions that use them.
Hide your first data row. Usually, the first row of a table is a number of field name headers. The next row is where the data starts. Sorting allows for this with its option for declaring the first row as a header. It is the second row, or what would be the first row of data that you want to hide...
- A1 - Header
- A2- Hidden
- A3 - First row of data.
Functions that use a column range as a parameter will use this first cell phrase...
A$2.... Since A2 is hidden, you will always be inserting and deleting rows behind it, and, therefore, not in danger of wrecking your range. The absolute row value discourages relative resets when copying the function.
Likewise, I make the last row off limits for data storage, but I seldom hide it. Usually the row is a narrow (Row Height = 7) delimiter whose background color is modified (light grey). Lets use row 20. Now my range for a function in cell D22 would look like this...
=SUM(D$2:D$20)
As you can see, I can copy this function anywhere and it will total the rows 2 thru 20 in whatever column I copy it to. If I add any new rows, that function will be updated and I don't have to worry about the new rows being outside the range. Also, if data is deleted, it is between the first and last rows, and the range value is protected.
This isn't that hard to set up, minor details really. But they can save a ton of gut ache finding the source of errors (rows inserted at the first row are not part of the range), or why your function all of sudden produces the #NAME?# error.

$