OK all, another efficiency question.
When a workbook drives off of data imported into a particular tab and updated periodically, in order for Excel to adjust to any changes in the data's structure (often a change in the number of rows of data), a dynamic INDEX function is used to tell Excel to find the lowest and farther right cell of the table. The formula that does this is as follows:
(Assume header in row 2, data starts in col 3)
$A$3:INDEX($3:$1048576,COUNTA($A$3:$A$1048576),COUNTA($2:$2))
This will index the entire spreadsheet, starting with the first data row. But, to increase Excel's efficiency, if the columnar structure of the table will not change, having Excel search all the way to column XFD is wasteful. Historically, I've modified this formula thusly (assume 10 columns of data):
$A$3:INDEX($3:$1048576,COUNTA($A$3:$A$1048576),COUNTA($A$2:$J$2))
But recently I got to thinking ... that formula is still telling Excel to index all the way to column XFD ... and should my modification actually be:
$A$3:INDEX($A$3:$J$1048576,COUNTA($A$3:$A$1048576),COUNTA($A$2:$J$2))
The first modified formula works fine, of course, but I'm wondering if I'm sacrificing calculation speed that would be improved by making the change to the second modified version.
Am I correct? Any other thoughts on how to keep this indexing efficient while keeping it dynamic to accommodate varying rows of data in any given data import?
Many thanks!
Bookmarks