Array formula? Select data from column B depending on adjacent value on Column A

wanstronian

New Member
Joined
Dec 12, 2008
Messages
10
Hi,

I have two columns of data, as below.

Col ACol B
FredWilma
BarneyBetty
BarneyBam Bam
FredPebbles
FredDino

<tbody>
</tbody>


I want to create, using formulas instead of macros if possible, two further lists, with headings of "Fred" and "Barney" and under each, is the list of people/dinosaurs associated with each. So the two resultant lists would be:

FredBarney
WilmaBetty
PebblesBam Bam
Dino

<tbody>
</tbody>


So effectively I want to be able to select the list of things in column B, where the adjacent value in Column A is equal to the heading in my new list. It feels like an array formula might do this, but my initial attempts have been catastrophic failure.

Can anybody help?

Thanks
W
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
maybe something like...

Excel 2012
AB
2FredWilma
3BarneyBetty
4BarneyBam Bam
5FredPebbles
6FredDino
7
8FredBarney
9WilmaBetty
10PebblesBam Bam
11Dino
12
13

<tbody>
</tbody>
Sheet5

Array Formulas
CellFormula
A9{=IF(ROWS($A$9:A9)>COUNTIF($A$2:$A$6,A$8),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=A$8,ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($A$9:A9))))}
B9{=IF(ROWS($A$9:B9)>COUNTIF($A$2:$A$6,B$8),"",INDEX($B$2:$B$6,SMALL(IF($A$2:$A$6=B$8,ROW($A$2:$A$6)-ROW($A$2)+1),ROWS($A$9:B9))))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,222,026
Messages
6,163,472
Members
451,838
Latest member
DonSlayer

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