# Multiple line subtotal

#### mijofr

##### Board Regular
Half the problem is phrasing my question.

Book 1, sheet 1, lists production by lot number.
 Column “A” lists the lot number, column “L” lists the quantity produced.
Book 2, sheet 1, lists shipments by lot number.
 Column “F” lists the lot number, column “G” lists the quantity shipped.

I’m developing book 3, sheet 1, which will compare shipments against production, and show me remaining inventory by lot number.
 Column “A” lists the lot number, column “J” lists the total quantity shipped (or is supposed to)
I have the following formula in cell “J2” which looks to book 2 and retrieves the quantity shipped from column “G”.
 =VLOOKUP(A2,'[book2]sheet1'!\$F:\$G,2,FALSE)

Here is my problem. The formula listed only retrieves a single shipment. There are times when a production lot is shipped on multiple lines. I need a formula that will retrieve and subtotal all of the shipments from that lot number.

I’m lost and need a push in the right direction.

Thanks all.

### Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Replies
3
Views
319
Replies
0
Views
194
Replies
4
Views
527
Replies
0
Views
235
Replies
2
Views
276

1,191,057
Messages
5,984,408
Members
439,884
Latest member
BrownEyedGirl

### 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.

### Which adblocker are you using?

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

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