Home » excel » Why is my index array skipping values in excel?

Why is my index array skipping values in excel?

Posted by: admin May 14, 2020 Leave a comment

Questions:

=INDEX(B:B, AGGREGATE(15, 6, ROW(1:999)/(C1:C999="Duplicated"), ROW(1:1)))

This for some reason is skipping 2 out of 47 values. Even though those cells have Duplicated in the C column.

How to&Answers:

Your cell range references are likely shifting as you extend your list and “falling off” your reference data list. If you look at the formula in the second cell in your index list it will likely look like this:

=INDEX(B:B, AGGREGATE(15, 6, ROW(2:1000)/(C2:C1000="Duplicated"), ROW(2:2)

Locking your cell ranges as absolute references (using F4) should populate your index list properly. I’m not sure if you need the array portion of your INDEX formula to refer to the entire B column, but if not, the formula in the first cell in your index list should look like this instead:

{=INDEX($B$1:$B$999, AGGREGATE(15, 6, ROW($1:$999)/($C$1:$C$999="Duplicated"), ROW(1:1)))}

Make sure to use ctrl+shift+enter when executing this to make it an array formula. Once copied down into your index list, the formula in the second cell in your index list will look like this:

{=INDEX($B$1:$B$999, AGGREGATE(15, 6, ROW($1:$999)/($C$1:$C$999="Duplicated"), ROW(2:2)))}

If possible, I would create a table from your data and replace your cell references with the table columns to cut down on processing time.

Answer:

Make sure you have consistent lengths in your ranges/columns

=INDEX(B:B, AGGREGATE(15, 6, ROW(1:999)/(C1:C999="Duplicated"), ROW(1:1)))

The index is all of column B
The duplicated is rows 1:999

If anything changes then there will be differences.
Either change the index to 1:999
or change the duplicated to the entire column(C:C)