vlookup on items and adding duplicates

bmpreston

Board Regular
Joined
Jun 18, 2016
Messages
120
Office Version
  1. 365
Platform
  1. MacOS
I'm trying to add up a quantity in a column, if the first column contains like numbers, also if another column contains a set number. As an example from the report I pulled, see below:

[TABLE="width: 310"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD="align: right"]Column B Column H
323 100579538[/TD]
[TD="align: right"]Col I [/TD]
[/TR]
[TR]
[TD="align: right"]323 100088098[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100088214[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]323 100088222[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]323 100088277[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100503009[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100505300[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100523351[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100523884[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100583204[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100584112[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]323 100088371[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]323 100567650[/TD]
[TD="align: right"]682[/TD]
[/TR]
[TR]
[TD="align: right"]323 100503017[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]323 100511750[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]324 100517484[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]324 100517961[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]324 100088197[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]324 100583446[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]324 100579538[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]324 100579538[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]324 100046955[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]324 100513078[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]


This didn't come over as a table, but it is three columns. Columns B, H, and I (Other columns are filled, but irrelevant information)

These columns are then sent to a new table, where I'm trying to accomplish the following:

Column B is a technician number, on this report of roughly 100,000 rows, there could be 100 or 150 unique numbers, for this example, I'm showing two numbers (323, and 324). Column H is a part number and these can be duplicated 10's of 1000's of times per report, and per technician number. Finally, column I is a quantity.

The way the report essentially works, Technician 323 uses part number X, Y times, rinse and repeat.

I'm trying to report this to a new table to show, the quantity of part X for each technician.

I want to declare a tech number, then it takes total quantity (I column counts) per part number.

To be clear on this, the report can be 100,000 rows, approximately 3000 unique part numbers (Column H), repeating at different intervals), and the total unique technician numbers is approx 100-150.

I hoping the output to just be a very simple:

Technician 323:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Part Number[/TD]
[TD]Quantity[/TD]
[/TR]
[TR]
[TD]100503021[/TD]
[TD]3 (Total Count of Column I for Part Number used by tech 323)[/TD]
[/TR]
[TR]
[TD]100511074[/TD]
[TD]7 (Total count of Column I for part number used by tech 323)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Thanks in advance
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
A pivot table will handle this for you very easily. Highlight all of your data including the column headers and select Insert, PivotTable. In the pivot table field list that will show up:
- pull your Technician field (or whatever you called your header for column B) to the Report Filter area below
- pull Part Number (or whatever you called your header for column H) down to the Row Labels area
- pull Quantity (or whatever you called your header for column I) down to the Values area.

You should have your working report if you go up to the top and select Technician 323, for example.
 
Upvote 0
This works quite well. Only think I'm not certain of is how to add the results together. It's giving me multiple counts and I'm unaware how to total up those counts.

(2 here, 4 there)

I'm looking for 6 used.

Thanks
 
Upvote 0
not sure what you mean specifically but have you tried using subtotals or grand totals (see the design tab of pivottable tools).
 
Upvote 0
So I rolled my own. I used an IF statement to check for tech number: Then used an array formula to check for each part number and bring the results into a table.

I then used a unique only advanced filter to bring me each part number into a new set of columns right next to it, finally performing an add with a SUMIFS out of the columns to get a total.

Thanks to all who helped, but the pivottable thing blew my mind. More than I could handle.
 
Upvote 0

Forum statistics

Threads
1,223,992
Messages
6,175,826
Members
452,673
Latest member
LaMiaAvy

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