Link to home
Start Free TrialLog in
Avatar of WeThotUWasAToad
WeThotUWasAToad

asked on

Extract certain items from one list to create another list in Excel

Hello,

Is there a way, in Excel, to extract certain items from one list and display them in order in a different list?

For example, suppose you have a spreadsheet in which column B contains a list of names and column C contains some designation for each name — in this case, a letter between A & E as shown here:

User generated image
Is there a way for Excel to automatically populate a list which includes each name from column B for which the corresponding column C letter matches a letter entered manually in the box at F2? In other words, suppose the letter "A" is manually entered in cell F2 as shown in the next screenshot. What formula will result in the list (column F) of the names from column B with a corresponding "A" in column C?

User generated image
And then in another example, if the manually-entered letter is "B", the resulting column F list should change as follows:

User generated image
So the goal is not only to display the names matching the entered criteria, but display them in a list populated from top to bottom (with no blank rows) and in the same order as those names appear in the original (column B) list. The latter is illustrated in the next screenshot where changing the letter for Grace (yellow cell C15) to "B" causes her name to be inserted in its proper position (between Ashley & Sarah) in the results list (column F).

User generated image
The desired functionality is identical to applying a filter to column C for the manually-entered letter (next screenshot below) to obtain the list of matching names as the new list (final screenshot below).

User generated image
User generated image
Thanks

File attached
2017-10-26_EE.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Alan
Alan
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.
In F4
=IFERROR(INDEX($B$4:$B$23,SMALL(IF($C$4:$C$23=$F$2,ROW($B$4:$B$23)-ROW($B$4)+1),ROWS(F$4:F4))),"")

Open in new window

and copy it down.

In D4
=IF(F4="","",ROW(A1))

Open in new window

and copy it down.
2017-10-26_EE.xlsx
Avatar of WeThotUWasAToad
WeThotUWasAToad

ASKER

Thanks for the responses.

Comment by: Alan

Does the attached work for you?

Yes Alan, it works perfectly! That's going to help me a lot.

By the way, I really want to understand your solution formula so I just opened a follow-up thread here:

https://www.experts-exchange.com/questions/29065183/Understanding-the-Array-form-of-the-Excel-INDEX-function.html
Hi,

No problem - happy to help.

Don't forget to close this question.

Alan.
Haha. I always close them eventually but I like to leave them open as long as possible in case other comments are posted.