Extract List from table with 2 variables

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
320
Office Version
  1. 365
Platform
  1. Windows
In the below table I would like to be able to get a list of items from List 1 That meets 2 criteria's. D1 gives me a choice of entry I am making, in this case fruit.
In Col E I would like to show a list of all items in List 1 that are equal to D1 and have a qty greater than 0 listed in C1:C8

ABCDE
1List 1TypeQtyFruitList 2
2ApplesFruitOranges
3OrangesFruit10Bananas
4BananasFruit10
5PearsFruit
6AlmondsNuts
7PecansNuts
8BrazilNuts
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
How about, in E2 filled down
=IFERROR(INDEX($A$2:$A$8,AGGREGATE(15,6,(ROW($A$2:$A$8)-ROW($A$2)+1)/(($B$2:$B$8=$D$1)*($C$2:$C$8>0)),ROWS(E$2:E2))),"")
 
Upvote 0
Try this array formula, in E2 and copy down

{=IFERROR(INDEX($A$2:$A$8, SMALL(IF(($B$2:$B$8=$D$1)*($C$2:$C$8>0), ROW($C$2:$C$8)), ROWS($D$2:D2))-1),"")}

Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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