HLOOKUP: List Aggregation

Austin80

New Member
Joined
Jan 23, 2016
Messages
3
Hi, I could probably solve this in VBA, but there's got to be a better way to do this in Excel.

I'd like collect every instance of an entry in list A, that appears in list B (with its search criteria), and put it in a results table, as shown below.

For example:

Excel_Challenge.png
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How you got 7,8,9,5 in column H against Goose ?
whereas column B has 3, 5, 8, 2 for Goose.


Regards,
DILIPandey
 
Upvote 0
You're exactly right, I knew I was tired last night, but that's embarrassing. Thanks for pointing that out.
 
Upvote 0
In C1, enter heading as "chk" and in c2, enter formula =VLOOKUP($A2,$D$2:$E$5,2,0)

Now, create a pivot table with "chk" field in Filter area and "Title" field and "Value" field in Rows area of pivot table. Right click-> pivot table options -> Display tab -> Classic pivot table layout.
Now, filter filed "chk" to Yes and your pivot should look like below:-

[TABLE="width: 535"]
<colgroup><col span="6"><col><col></colgroup><tbody>[TR]
[TD]Title[/TD]
[TD]Value[/TD]
[TD]chk[/TD]
[TD]Search[/TD]
[TD]Search[/TD]
[TD][/TD]
[TD]chk[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD="align: right"]33[/TD]
[TD]Yes[/TD]
[TD]G[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD="align: right"]34[/TD]
[TD]No[/TD]
[TD]D[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]T[/TD]
[TD="align: right"]25[/TD]
[TD]Yes[/TD]
[TD]T[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD]Title[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD="align: right"]28[/TD]
[TD]Yes[/TD]
[TD]C[/TD]
[TD]No[/TD]
[TD][/TD]
[TD]G[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD="align: right"]10[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD="align: right"]28[/TD]
[/TR]
[TR]
[TD]T[/TD]
[TD="align: right"]5[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD="align: right"]98[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD="align: right"]89[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD="align: right"]63[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD="align: right"]93[/TD]
[/TR]
[TR]
[TD]T[/TD]
[TD="align: right"]59[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]G[/TD]
[TD="align: right"]98[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD="align: right"]6[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]G Total[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD="align: right"]48[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]T[/TD]
[TD="align: right"]39[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T[/TD]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD="align: right"]93[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T[/TD]
[TD="align: right"]39[/TD]
[/TR]
[TR]
[TD]G[/TD]
[TD="align: right"]89[/TD]
[TD]Yes[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T[/TD]
[TD="align: right"]59[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD="align: right"]17[/TD]
[TD]No[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T Total[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Grand Total[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Which will show you all fields marked as Yes and their respective values :)


Regards,
DILIPandey
 
Upvote 0
Another option.

For original data as shown in columns A:B and D:E below

1. Leave F1 blank
2. Put the formula shown in F2
3. Select A1:B16
4. Data ribbon tab|Sort & Filter Group|Advanced|Copy to another location|List range: (should already be populated with A1:B16)|Criteria range: F1:F2|Copy to G1 (say)|OK

Results are as shown in columns G:H

To tidy up if required:
5. Clear F2
6. Sort results table

Excel Workbook
ABCDEFGH
1TitleValueSearchSearchTitleValue
2G33GYesTRUEG33
3D34DNoT25
4T25TYesG28
5G28CNoT5
6C10G98
7T5T59
8G98G6
9D63T39
10T59G93
11G6G89
12C48
13T39
14G93
15G89
16D17
17
List
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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