Using INDEX SMALL array function to pull rows of data from another worksheet

imwhoim

New Member
Joined
Dec 14, 2017
Messages
2
I'm trying to create a workbook that has a summary page as the first sheet, where you select a piece of equipment from a dropdown menu and have it auto-populate data about that equipment on the summary sheet. My roadblock is in trying to create a table on that "Summary" sheet that pulls rows of data from a "Records" sheet that contains multiple columns of data (in columns B-F, i.e. date, type of service, parts used, description) for each row of data that corresponds to a piece of equipment (Equipment name located in column A), of which there are multiple instances. I've found a useful INDEX/SMALL/IF function, but it only seems to work when being used on the "Records" sheet. If I copy the same function onto the "Summary" sheet and change the ranges to reference back to the "Records" sheet, it doesn't return any data (no error, just a blank cell). Example:

On the "Records" sheet I utilized this function (where I15 is the piece of equipment I want info on):

=IFERROR(INDEX($A$1:$F$20,SMALL(IF($A$1:$A$20=$I$15,ROW($A$1:$A$20)),ROW()-2),2),"")

Then I try to utilize the same function on the "Summary" sheet by using (where C4 if the piece of equipment I want info on):

=IFERROR(INDEX(Records!$A$1:$F$20,SMALL(IF(Records!$A$1:$A$20=$C$4,ROW(Records!$A$1:$A$20)),ROW()-2),2),"")

Am I not able to reference multiple sheets using this function? Does the range being referenced and the array have to be on the same sheet?

Thanks in advance for the help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You're probably getting a blank because of the IFERROR function. I'd assume it's a reference issue between the sheet names.

With that said, in-cell functions/formulas can only affect the value of the cell they are in (UDFs might provide more, but I've never tried).

If you want to keep away from VBA, look into using the advanced filter. If you're trying to have an autotable adjust based on the selection of an equipment piece from a data validation list or combobox, VBA would be the solution.
 
Upvote 0
What happens if you change your formula to:

[TABLE="width: 917"]
<colgroup><col width="917"></colgroup><tbody>[TR]
[TD="width: 917"]
Code:
[TABLE="width: 917"]
<colgroup><col width="917"></colgroup><tbody>[TR]
   [TD="width: 917"]=INDEX(Records!$A$1:$F$20,SMALL(IF(Records!$A$1:$A$20=$C$4,ROW(Records!$A$1:$A$20)-ROW(Records!$A$1)+1),ROWS($A$1:A1)),2)[/TD]
 [/TR]
</tbody>[/TABLE]

[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
With this formula I get a #NUM ! error....


What happens if you change your formula to:

[TABLE="width: 917"]
<tbody>[TR]
[TD="width: 917"]
Code:
[TABLE="width: 917"]
<tbody>[TR]
[TD="width: 917"]=INDEX(Records!$A$1:$F$20,SMALL(IF(Records!$A$1:$A$20=$C$4,ROW(Records!$A$1:$A$20)-ROW(Records!$A$1)+1),ROWS($A$1:A1)),2)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
This is an array formula. Did you enter it with CTRL-SHIFT-ENTER? If not put cursor in cell with formula press F2 for edit and then CTRL-SHIFT-ENTER.
Also check to make sure there is a match for C4 in column Records!A1 to A20 (make sure one isn't text and the other is numeric).
Does your data have a header row (say in row 1)?
If this doesn't help post a small sample of your data. One way is to put a border around the data and then use copy paste.
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,595
Members
452,657
Latest member
giadungthienduyen

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