Using Index Counta to set up a dynamic range is not returning the correct value, but sing offset doe

Brass Contributor

I have a worksheet that is doing a ton of calculations so I am trying to streamline it a bit so it will be more friendly to slower computers, Originally I set up dynamic named ranges using offset OFFSET('FLOP DATA'!$A$13,0,0,COUNTA('FLOP DATA'!$A:$A),1))

This works fine and returns the accurate result when doing a count of 74

I am wanting to switch these to a less volatile argument so I was using

('FLOP DATA'!$A$13:INDEX('FLOP DATA'!$A:$A, COUNTA('FLOP DATA'!$A:$A)))

This is returning a count value of 63 and dropping of the bottom of the range, The values in the range are all numbers and have no blanks etc...

 

Also is using IFERROR(INDEX(FLOP,MATCH($P14,DBNUM,0)),"") less of a drain on computer resources than using vlookup?

3 Replies

@Dichotomy66 , perhaps it shall be

('FLOP DATA'!$A$13:INDEX('FLOP DATA'!$A:$A, COUNTA('FLOP DATA'!$A:$A)+13))

or so, index starts from first row and you need to add some offset.

 

In general with dynamic ranges OFFSET is more easy in maintenance (at least for me), but INDEX is much better from performance point of view.  Thus on small ranges it doesn't matter what to use, but on relatively big ones INDEX is definitely more preferable.

 

That does seem to work I will have tp test is a lot.On this worksheet the data set is replaceable and can be anywhere from a 30x 8 array to an 1177 x 8 array . Also I am using about 14 named ranges so this is especially where I am trying to get rid of offset though it is super easy to use 

Your INDEX-COUNTA formula for the dynamic range is correct, provided that A1:A12 are not blank. If A1:A12 are blank, the last 12 cells in Column A would be excluded from your dynamic range. If 11 out of the 12 cells in A1:A12 are blank, which I suspect is true in your case, then the last 11 cells would be excluded from your dynamic range, such that it only counts 63 instead of 74. To remedy the possible existence of blank cells above the starting row of your dynamic range, exclude A1:A12 through this formula:
='FLOP DATA'!$A$13:INDEX('FLOP DATA'!$A$13:$A$1048576,
COUNTA('FLOP DATA'!$A$13:$A$1048576))