user1416564
user1416564

Reputation: 401

Excel macro store value of vlookup and then add them up

So I have the following sheet setup:

Sheet 1 A B C Tomatoes 100 50 Onions 20 0 Garlic 10 0 Chicken 0 100 Cheese 0 20

Where each column after A is a recipe and going down is the amount of grams required in the recipe of the ingredient.

Sheet 2 has cost per 100 grams per ingredient like so:

A B Chicken 10 Tomatoes 1.5 Onions 2.25

What I'd like to do, is at the bottom of sheet 1 (ideally) under each column I could have the cost for the recipe.

In my mind it's broken down into 2 steps. Step 1 is do a vlookup from Sheet 1 to replace the grams to cost. Then do a sum of the entire column. I just don't know how to do that either in a macro or formula.

Upvotes: 0

Views: 53

Answers (1)

Karthikeyan Vedi
Karthikeyan Vedi

Reputation: 1360

Refer the below specified link,

https://www.ablebits.com/office-addins-blog/2014/08/05/excel-vlookup-sum-sumif/#lookup-sum

You can download their worksheet here

Upvotes: 2

Related Questions