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?
 
What does it return and what is expected?

What should be happening with the array is this...I have a table on a spreadsheet called Data that has information from row 2 through 217. On another spreadsheet I have a blank table that should populate based on the choice made from a drop down list in cell M3.

Here's a general example, let's say the table on the Data spreadsheets contains information that is categorized by food type (e.g. meats, vegetables, fruits, starches, diary) in column C, on anther spreadsheet I have those same categories in a drop down list. If I choose meats in the drop down list, the blank table should fill in all the foods that have meats as the category (column C on the data spreadsheet) and put that info into column A on the current spreadsheet. The array should not leave any blank rows.

Again, the formula works fine for data in rows 2:170 (the old data) but it's ignoring the new rows of data that I've added (rows 171:217). As you can see below, the formula is exactly the same except the reference to row 217.

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))),"")}

I'm totally stumped.
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try please either to provide a copy of your file via an external source like dropbox or to literally respond to the diganostic questions like:

What do we get with:

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

=SUMPRODUCT((Data!$C$171:$C$217=$M$3)+0)

=SUMPRODUCT((TRIM(Data!$C$171:$C$217)=$M$3)+0)
 
Upvote 0
I attempted to respond to the countif question, so maybe I should try sharing the file via dropbox. Can I share with you through this forum or take a different route?
 
Upvote 0
I attempted to respond to the countif question, so maybe I should try sharing the file via dropbox. Can I share with you through this forum or take a different route?

A public dropbox is ok.

Try please either to provide a copy of your file via an external source like dropbox or to literally respond to the diganostic questions like:

What do we get with:

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

=SUMPRODUCT((Data!$C$171:$C$217=$M$3)+0)

=SUMPRODUCT((TRIM(Data!$C$171:$C$217)=$M$3)+0)

These should be easy to answer, no?
 
Upvote 0
Aggressive Allocation (M3) does not occur in Data!$C$171:$C$217.

Correct, it occurs somewhere in rows 2:170 which work fine. The problem is I added additional data and the table now extends to row 217. If you use the category selector (A3) and choose Corporate Bond (which is on row 206) you will get nothing. None of the securities from row 171:217 will show up. That's my problem. The array works fine as long as data is in rows 2:170 but it totally ignores the data from 171:217.
 
Upvote 0
Correct, it occurs somewhere in rows 2:170 which work fine. The problem is I added additional data and the table now extends to row 217. If you use the category selector (A3) and choose Corporate Bond (which is on row 206) you will get nothing. None of the securities from row 171:217 will show up. That's my problem. The array works fine as long as data is in rows 2:170 but it totally ignores the data from 171:217.

Nothing wrong with that either...

Not just Corporate Bond must occur in the C-range, also 1 in the X-range. The latter is not the case.
 
Upvote 0
Nothing wrong with that either...

Not just Corporate Bond must occur in the C-range, also 1 in the X-range. The latter is not the case.

GEEZ LOUISE!!! I am so sorry. It never occurred to me to check my second condition. I simply needed to copy the formula down. I saw the fields weren't populating and instantly panicked.

Thank you so much.

You ROCK!!!
 
Upvote 0

Forum statistics

Threads
1,215,389
Messages
6,124,662
Members
449,178
Latest member
Emilou

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