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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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:-

TitleValuechkSearchSearchchkYes
G33YesGYes
D34NoDNo
T25YesTYesTitleValue
G28YesCNoG6
C10NoG28
T5YesG33
G98YesG89
D63NoG93
T59YesG98
G6YesG Total
C48NoT5
T39YesT25
G93YesT39
G89YesT59
D17NoT Total
Grand Total

<colgroup><col span="6"><col><col></colgroup><tbody>
</tbody>

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,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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