Extracting Data From A List

mfronczak

New Member
Joined
Mar 10, 2002
Messages
9
Okay, I'm pretty good with Excel now, but there is on problem I'm having. How do I search a list (or array) for certain values, then extract those values to another list? For instance, suppose I have the following in cells A1:B7=

No A
No B
Yes C
No D
No E
Yes F
No G

And I want to end up with:
In cell C1: C
In cell C2: F

All I want to do is extract the "Yes" values and put them in a row or column one after the other, without blank cells. I also need to do this with a formula as opposed to filtering or writing a macro. Any help would be appreciated.

Mike
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi

I know you say as "apposed to filetring", but the advanced filter would do this nicely as would a very simple Pivot Table.
 
Upvote 0
Select cells D1:D7 and enter the array formula...

{=SMALL(IF(ISNUMBER(MATCH(A1:A7,{"Yes"},0)),ROW(A1:A7)),ROW(A1:A7))}

Note: Array formulas must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.

Next, enter the formula, =IF(ISNUMBER(D1),INDEX(B:B,D1),""), into cell C1 and Fill Down to C7.

Hide column D if desired.
This message was edited by Mark W. on 2002-03-11 09:43
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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