Which function(s) can be used for this?

Python49

New Member
Joined
Aug 18, 2018
Messages
32
A bit stumped on this one, although I feel like it's probably just a basic combination of sumproduct, VLOOKUP, index or something else that likely can make this quite easy. Although I could be wrong. The situation is pretty straight forward:

I have a chart that lists out different flavors of cookies on column A and then ingredients listed across row 1. It's a table that just allows each product to list out the quantity used for each ingredient. So for instance, on the column A, there might be 3 different types of chocolate. 1) Chocolate 2) Double Chocolate 3) Triple Chocolate. The normal chocolate uses 10g cocoa, double 20g, triple 30g. I have a table like this.

A- (Recipe Quantity)BCD
CocoaVanillaStrawberry
Chocolate10--
Double Chocolate20--
Triple Chocolate30--

Then for the production ledger for the day, I want to be able to list out the different quantities of cookies we made and let the formula just total the total cocoa used. So if we made 3 normal chocolate (30g), 2 double (60g), and 1 triple (30g) that's a total of 120g consumed.

Production LedgerQuantity
Chocolate3
Double Chocolate2
Triple Chocolate1

I was doing this manually previously for a while by just adding a new ingredient and then manually doing a formula such as:

=SUMIF ( Production Ledger'!A:A , Production Ledger'!A3 (cookie being made), Production Ledger'!B:B) <--- gives cookie type quantity * SUMIF( 'Recipe Quantity'!A:A, 'Production Ledger'!A3, 'Recipe Quantity'!B:B)<-- cocoa per cookie
SUMIF ( Production Ledger'!A:A , Production Ledger'!A4, Production Ledger'!B:B) * SUMIF( 'Recipe Quantity'!A:A, 'Production Ledger'!A4, 'Recipe Quantity'!B:B)
SUMIF ( Production Ledger'!A:A , Production Ledger'!A5, Production Ledger'!B:B) * SUMIF( 'Recipe Quantity'!A:A, 'Production Ledger'!A4, 'Recipe Quantity'!B:B)

So then I just end up with an incredibly long formula but it gets the job done. But it's become unsustainable. Any help?
 
Last edited:
Something like this?

Book1
ABCD
2MaterialCocoaVanillaStrawberry
3Quantity200
4Usage120
5Balance80
6
7
8A- (Recipe Quantity)BCD
9CocoaVanillaStrawberry
10Chocolate10--
11Double Chocolate20--
12Triple Chocolate30--
13
14
15
16Production LedgerQuantity
17Chocolate3
18Double Chocolate3
19Triple Chocolate1
Sheet1
Cell Formulas
RangeFormula
B4B4=SUMPRODUCT(B10:B12,B17:B19)
B5B5=B3-B4
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Isn't it 3 normal chocolate (30g), 2 double (40g), and 1 triple (30g) that's a total of 100g consumed.

Does this work?

Book18
ABCD
1A- (Recipe Quantity)BCD
2CocoaVanillaStrawberry
3Chocolate1020
4Double Chocolate2000
5Triple Chocolate3000
Recipe


Book18
ABCD
1Production LedgerQuantity
2Chocolate336
3Double Chocolate240
4Triple Chocolate130
Production
Cell Formulas
RangeFormula
D2:D4D2=SUMPRODUCT(B2*Recipe!B3:D3)


or is the product more straight-forward than this? Just 3 times the cocoa, etc.?
Yes it seems that you added additional data to another column. I was hoping to just have everything in one cell since the number of different ingredients will be a lot, so having an additional column for each ingredient would become a lot. There will be like 200 ingredients listed that I'm looking to get the opening and closing stock for.
 
Upvote 0
Yes it seems that you added additional data to another column. I was hoping to just have everything in one cell since the number of different ingredients will be a lot, so having an additional column for each ingredient would become a lot. There will be like 200 ingredients listed that I'm looking to get the opening and closing stock for.
Just want to show the formula. It would help if you show how your worksheet will looks like, just like kweaver asked.

I just created another table to illustrate the calculation :giggle:
 
Upvote 0
Something like this?

Book1
ABCD
2MaterialCocoaVanillaStrawberry
3Quantity200
4Usage120
5Balance80
6
7
8A- (Recipe Quantity)BCD
9CocoaVanillaStrawberry
10Chocolate10--
11Double Chocolate20--
12Triple Chocolate30--
13
14
15
16Production LedgerQuantity
17Chocolate3
18Double Chocolate3
19Triple Chocolate1
Sheet1
Cell Formulas
RangeFormula
B4B4=SUMPRODUCT(B10:B12,B17:B19)
B5B5=B3-B4
Yes, but the recipe quantities and production ledger are on different sheets and of different range sizes. Also would need the formula to match on it's own which values to sumproduct.
 
Upvote 0
Just want to show the formula. It would help if you show how your worksheet will looks like, just like kweaver asked.

I just created another table to illustrate the calculation :giggle:
Yes, will try to just send this. Didn't have the plugin setup yet and wasn't home yet. Will try to just upload this when I get back.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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