Array Ignoring last cell reference

DJ'sGiGi

Board Regular
Joined
May 25, 2007
Messages
92
I have the following array:

{=IFERROR(INDEX(Data!$A$2:$A$170,SMALL(IF(Data!$C$2:$C$170=$M$3,IF(Data!$X$3:$X$170=1,ROW(Data!$A$2:$A$170)-ROW(Data!$A$2)+1)),ROWS($A$7:A7))),"")}

which works perfectly (for the most part.) The only problem I have is that the array will not return the data that is on row 170 (the last row of data) and I'm not sure how to fix it. The array basically says look at the category in cell $M$3 and if cell X_ = 1, then return the data. Again, the data returns fine except when it should be returning the data in row 170. Any suggestions?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
is the data in A170 the same as any of the other cells, if so you may have to drag it down more.
 
Upvote 0
Try the following edit...

$X$3 --> $X$2

in:
Rich (BB code):
{=IFERROR(INDEX(Data!$A$2:$A$170,SMALL(IF(Data!$C$2:$C$170=$M$3,
     IF(Data!$X$2:$X$170=1,ROW(Data!$A$2:$A$170)-ROW(Data!$A$2)+1)),
     ROWS($A$7:A7))),"")}
 
Upvote 0
or you could try, iferror(index(Data!$A$2"$A$170,Aggregate(15,6.row(Data!$A$2:$A$170)-row(DATA!$A$2)+1/(Data!$C$2:$C$170=$M$3),ROWS($A$7:A7)),"")

please be advised this isnt an array formula that requires Ctrl+Shift+Enter
 
Upvote 0
Try the following edit...

$X$3 --> $X$2

in:
Rich (BB code):
{=IFERROR(INDEX(Data!$A$2:$A$170,SMALL(IF(Data!$C$2:$C$170=$M$3,
     IF(Data!$X$2:$X$170=1,ROW(Data!$A$2:$A$170)-ROW(Data!$A$2)+1)),
     ROWS($A$7:A7))),"")}

Woo-whoo!!! Works perfectly. Thanks Aladin.
 
Upvote 0
Aladin, you helped me with an array before. Now I have a new issue. I'm using the same array, but I expanded the data in my table from row 2:170 to row 2:217. My array reference automatically updated fine but now the new array totally ignores any data in rows 171:217 (the new data). Any ideas why? The old and new formulae are below:

OLD: {=IFERROR(INDEX(Data!$A$2:$A$170,SMALL(IF(Data!$C$2:$C$170=$M$3,IF(Data!$X$2:$X$170=1,ROW(Data!$A$2:$A$170)-ROW(Data!$A$2)+1)),ROWS($A$7:A7))),"")}

NEW: {=IFERROR(INDEX(Data!$A$2:$A$217,SMALL(IF(Data!$C$2:$C$217=$M$3,IF(Data!$X$2:$X$217=1,ROW(Data!$A$2:$A$217)-ROW(Data!$A$2)+1)),ROWS($A$7:A7))),"")}

Thanks.
 
Upvote 0
Aladin, you helped me with an array before. Now I have a new issue. I'm using the same array, but I expanded the data in my table from row 2:170 to row 2:217. My array reference automatically updated fine but now the new array totally ignores any data in rows 171:217 (the new data). Any ideas why? The old and new formulae are below:

OLD: {=IFERROR(INDEX(Data!$A$2:$A$170,SMALL(IF(Data!$C$2:$C$170=$M$3,IF(Data!$X$2:$X$170=1,ROW(Data!$A$2:$A$170)-ROW(Data!$A$2)+1)),ROWS($A$7:A7))),"")}

NEW: {=IFERROR(INDEX(Data!$A$2:$A$217,SMALL(IF(Data!$C$2:$C$217=$M$3,IF(Data!$X$2:$X$217=1,ROW(Data!$A$2:$A$217)-ROW(Data!$A$2)+1)),ROWS($A$7:A7))),"")}

Thanks.

What does this deliver?

=COUNTIF(Data!$C$171:$C$217,$M$3)
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top