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.
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
Related
Considering the following data :
sheet1 (customers)
A
0 customer_name
1 john
2 kevin
3 mickael
sheet2 (products)
A
0 product_name
1 book
2 ball
3 game
sheet3 (orders)
A B
0 customer_name product_name
1 john book
2 john game
3 mickael ball
I would like to know for each combination of customer and product if an order has been ordered and display it in the sheet1 to get something like that :
sheet1 (customers updated )
A B C D
0 customer_name book ball game
1 john 1 0 1
2 kevin 0 0 0
3 mickael 0 1 0
I know how to do that with "code" (by doing a macro in vba or a small exe in c# that will update the file), but I want to do it (if its possible) by just setting a formula inside my sheet (fyi, I can put the 3 inputs in the same sheet if needed, that's not a constraint
Updated :
with the previous configuration described, I have put the following formula in sheet1 B2 : =COUNTIFS(Sheet3!$A:$A;$A2;Sheet3!$B:$B;B$2), and when running the formula and extending it to every cell in my sheet I am getting everywhere the value #NAME? (I've translated if from french so I am not sure if its the right error in english). I think where I am making a mistake is that I am not using sheet2, how can I say first to "do all the combinations possible of customers insheet1 and products in sheet2 and look for those combinations in sheet3, knowing that I am in sheet1 and that I want to display the result like aking before?
Use COUNTIFS:
=COUNTIFS(Sheet3!$A:$A,$A2,Sheet3!$B:$B,B$1)
I have a master worksheet and a Extract worksheet.
I want to extract data from Extract sheet and present it as follows in the master sheet.
Data is as follows:
Extract Sheet
--------------------------------------
Fruit Nutrients Proportion
Apple Calcium 10
Apple Vitamin B 20
Mango Vitamin A 50
Lemon Vitamin C 30
Lemon Vitamin A 10
Master Sheet
--------------------------------------------------------
Fruit Calcium Vitamin A Vitamin B Vitamin C
Apple 10 0 20 0
Mango 0 50 0 0
Lemon 0 10 0 30
I have used Excel Array functions SMALL and INDEX but
I am unable to get the Proportion value in the master table.
I keep getting #NUM error
Please help me with the same and guide.
Thanks in advance.
I've put your sample data and results into a single worksheets as per the following image but you should be able to move the Extract to another worksheet and transcribe the formula for your own purposes.
The standard formula in F2 is =IFERROR(INDEX($C$2:$C$6,MIN(INDEX(ROW($1:$5)+(($A$2:$A$6<>$E2)+($B$2:$B$6<>F$1))*1E+99,,))),0). Fill both right and down as necessary. You mentioned using SMALL but you have no duplicated values across the two criteria columns so I think this is closer to what you require. Post back a comment if you do need a SMALL function with k picking the first, second, etc.
Try this:
=IFERROR(LOOKUP(2,1/(('Extract '!$A$2:$A$6=$A2)*('Extract '!$B$2:$B$6=B$1)),'Extract '!$C$2:$C$6),0)
Below I have two charts, the first does not have the value of calories, the second does. (The values are arbitrary - this is just an example.) I need to find a way to fill in the value of the calories in the first chart by matching all the values of wheat, flour, barley, and rye with the second chart. If all the values match, then I need it to copy that number of calories into the first chart. For example, row 2 has matching values with row 13, so I need to copy 100 calories into the E2 cell.
Does anyone have a formula that can do this?
A B C D E
1 Wheat Flour Barley Rye Calories
2 1 0 0 2
3 4 2 4 0
4 1 4 5 2
5 0 3 2 1
6 1 6 8 9
10 KEY
11 A B C D E
12 Wheat Flour Barley Rye Calories
13 1 0 0 2 100
14 0 3 2 1 150
Insert a column between Rye and Calories, in E12 enter =A12&B12&C12&D12 and copy down to suit.
In F2 enter =VLOOKUP(A2&B2&C2&D2,E$13:F$14,2,0) (or extend range if required) and copy down to suit.
This assumes both arrays are in the same sheet.
Tidy up by selecting ColumnF, Copy, Paste Special..., Values over the top and then delete ColumnE.
I'm new so can't post pics... I added a column to be the new A column that details different weight measurements (1.0 grams, 1.25 grams etc)
In cell B3 (or whatever cell is directly under Wheat at the top, paste the following and then paste over and across:
+IFERROR(INDEX($B$9:$F$16,MATCH($A3,$A$9:$A$16,0),MATCH(B$2,$B$8:$F$8,0)),0)
where $B$9:$F$16 is your whole table of original data
where $A3 is your identifier in your top chart (1.0 grams in my example)
where $A$9:$A$16 is the range in your data chart that lists gram measurements (1.0 grams - 10.0 grams or whatever)
where B$2 is Wheat in top chart
where $B$8:$F$8 is Wheat to Calories in bottom chart.
Hope this helps.
I've been trying to figure this out but I don't seem to get it right.
I have a spreadsheet with reports for different categories detailed by day (e.g. Toys, Drinks, General Store, Meat Store, Veggies, etc)
So, my spreadsheet looks something like this:
Toys
Day Me Wife Kid1 Kid2
9/28/13 0 0 0 0
10/1/13 29 3 0 0
10/2/13 0 7 34 25
10/4/13 0 0 0 0
AVERAGE 29 5 34 25
.
Drinks
Day Me Wife Kid1 Kid2
9/30/13 102 15 0 0
10/1/13 0 0 25 0
AVERAGE 102 20 0 0
etc etc
So the idea would be that I need to be able to find the Average row number for each different category, but I can't just look for it easily because in one category there might be expenses on more months (hence, more rows between the category's title and the average row). Any clues?
You can use
=ROW()+MATCH("AVERAGE",$A2:$A$1001,0)-1
The row reference to A2 is variable and you can paste it next to the category of interest. The row reference to A1001 is just far enough down in your spreadsheet to include all the data, and is fixed (but doesn't have to be).
You can use something like this perhaps:
=MATCH("AVERAGE",INDIRECT("A"&MATCH("Drinks",A:A,0)&":A1000"),0)+MATCH("Drinks",A:A,0)-1
MATCH("Drinks",A:A,0) returns the row number of Drinks
Which is used by INDIRECT and to convert into a range, from which MATCH then returns the number of rows after that header. Add to the number of rows before Drinks and remove 1 to get the actual row number.
Change the range of A1000 accordingly. I assumed a maximum of 1000 rows here.
Edit, if you have cross-sheet referencing, you need to change the formula to:
=MATCH("AVERAGE",INDIRECT("'Sheetname'!A"&MATCH("Drinks",'Sheetname'!A:A,0)&":A1000"),0)+MATCH("Drinks",'Sheetname'!A:A,0)-1
Assuming Sheetname is the name of that sheet.
I have two files:
File#1 contains customer with demand information. There are only three columns that matter to me:
Part#
Demand Qty
Demand Date
The file has thousands of lines.
File#2 is my own file which has more of an MRP setup:
columns are labeled with dates (weekly)
For each Part: There are the following rows:
Demand
Incoming Inventory
Net Inventory
My general idea was that I could somehow filter both files by part#, then have the code "sumif" the total demand by week, and copy it from the customer file to my file on the corresponding demand row. Then loop this for all part #s.
Part #s are constantly being added/removed in my spreadsheet(as new projects develop, and old ones phase out), so it would be ideal if the code didnt need to be maintenenced as my file is updated with new parts.
It seems like you could use a SUMPRODUCT formula to bring those numbers in without code. This example uses two sheets in the same workbook so you'd have to adjust slightly for different workbooks. In Sheet1 you have three ranges which I've named rngPartNum, rngDemandDate, and rngDemandQty. I used dynamic range names that expand with the data, but you could use cell references that cover a sufficient number of rows. The data looks like this
PartNum Demand Qty DemandDate
1 18 3/28/2011
1 6 3/30/2011
1 6 4/2/2011
2 18 3/28/2011
2 6 3/30/2011
2 6 4/2/2011
2 16 3/28/2011
3 3 3/30/2011
3 15 4/2/2011
3 9 3/28/2011
3 18 3/30/2011
Sheet2 has a week-end date and a part number on each row.
Part Week Demand
1 4/1/2011 24
1 4/8/2011 6
1 4/15/2011 0
2 4/1/2011 40
2 4/8/2011 6
2 4/15/2011 0
3 4/1/2011 30
3 4/8/2011 15
3 4/15/2011 0
The formula in the demand column is this
=SUMPRODUCT((rngPartNum=A2)*(rngDemandDate<=B2)*(rngDemandDate>B2-7)*(rngDemandQty))
That sums everything in rngDemandQty where rngPartNum matches A2 AND rngDemandDate is less than or equal to B2 AND rngDemandDate is greater than a week before B2. As long as you have every part number and enough weeks on your Sheet2, the total should match Sheet1.