Creating a list from a named range

GuyGadois

Active Member
Joined
Jan 12, 2009
Messages
342
Office Version
  1. 2019
Platform
  1. Windows
I have a spreadsheet that lists a number of items, the second columns says if it will be Sold or Purchased and then the third column has a value. I would like to create a list that takes all the "Sell" from the list above and lists them with the value in the column next to the name. I am fairly sure I should use an Array and Match but unsure how to do it.


NameActionValue
aBuy10
B66
CSell33
DBuy4

<tbody>
</tbody>

I want a table to dynamically generate the listing of the buy info
BuyA10
BuyD4

<tbody>
</tbody>

Any help is greatly appreciated.

GG
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Perhaps something like this?
A​
B​
C​
D​
E​
F​
G​
1​
NameActionValueBuyNameActionValue
2​
aBuy10aBuy
10​
3​
B66DBuy
4​
4​
CSell33
5​
DBuy4
D1 contains your criteria
E2=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$5=$D$1,ROW($A$2:$A$5)),ROWS($A$1:A1))),"")
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself.

Copy down, then copy all across as needed
 
Upvote 0
That works well. Thank you for helping out. One additional question. Is it possible to make the generated list list "Buy" and "Sell" data (multiple Actions not just one)?

Guy?
 
Upvote 0
If you will only have Buy, Sell or nothing, try this toi get both Buy and Sell
=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$5<>"",ROW($A$2:$A$5)),ROWS($A$1:A1))),"")
ARRAY entered
 
Upvote 0
Actually, I have 4 variables. I would like to make a list that contains "Sell" and "Sell All". I think it is best to use If(or()) but I can't seem to get it to work. Any help is very appreciated.

This is what I am using which doesn't work:

=IFERROR(INDEX(C:C,SMALL(IF(OR($T$4:$T$200="Sell",$T$4:$T$200="Sell All")),ROW($C$4:$C$200)),ROWS($C$1:C1))),"")

C:C - name
T = action

Guy

If you will only have Buy, Sell or nothing, try this toi get both Buy and Sell
=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$5<>"",ROW($A$2:$A$5)),ROWS($A$1:A1))),"")
ARRAY entered
 
Last edited:
Upvote 0
Can anyone help with using the "OR" function within an index function?
 
Upvote 0

Forum statistics

Threads
1,215,412
Messages
6,124,761
Members
449,187
Latest member
hermansoa

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