find item in col a then find sub item col b give col c data - excel-2010

I have a spreadsheet that inputs meal from drop down then it is looking for the nutrition information from another sheet that has the meal in col a and then the nutrients in col b the amounts in col c this is the item i want below is what the data page looks like:
Hamburger Soup
Nutrient amount unit
Calories 208
fat 7 g
fiber 3 g
carbs 23 g
sodium 539 mg
potassium 672 mg
sugars 5 g
Vit. A 27 mg
Vit. C 8 mg
Vit. K 14 mg
calcium 44 mg
iron 2 mg
protien 13 g
So i am trying to get this information to populate on the first spreadsheet which is menu and these are on nutrients. I have tried using vlookup and index and match but i keep getting errors of the wrong info. Any Help would be appreciated

After a lot of trial an error and figured it out I had to add an extra row to identify what row the meal was on then I utilized this following formula utilizing an if statement i checked to see if the meal location was empty if so I placed a blank if it was populated it then put the row into a hidden column and cell. then I did an offset command looking at the nutrient sheet and then went down the number of rows for the nutrient and then read the 2nd column. this is the formula "if T19="","",offset(nutrients!$a$2,v19+1,2) this populated the correct fields and space. Thank you for all of the information that you had given.

Related

Google sheets tip calculator and tax estimator

I'm having trouble getting google sheets to do what I want it to do.
I have a form that adds new rows into a google sheets spreadsheet
The entries are then further manipulated in new columns that don't correlate to the google form.
I wanted 3 columns of deductions to be subtracted from 1 column being a daily intake
a. example:
[] gForm:Daily bank(A) | gForm:Credit Cards(B) | gForm:Tip outs(C) | gForm:Total Cash(D) | Column E
1 30 30 40 200 100
2
3
I want each line in Column E to automatically populate the code in each new row, that takes column D and subtracts A:C and spits out the difference in Column E.
code example idea: =sum(D:D-sum(A:C))
I made this an Array formula: Below
=ARRAYFORMULA(IF(ROW(G:G)=1, "Total Taxable Cash", IF(ISBLANK(F:F), "", ArrayFormula(F:F-(sum(C2:E2))))))
PROBLEM is that it takes every cell in colums A:C and then subtracts each row in Column D to spit out incorrect answers in Column E.
Does anyone know how to code this so that it adds the code automatically to each new row but also calculate each row individually and not as columns.
Please help me, thank you all.
Michael, your examples in your post are inconsistent. You reference A:D and SUM(C:D), but then your formula example uses G, F and SUM(C2:E). I'll assume that your formula is correct and your example data above it is wrong.
I also don't clearly understand your goal. But at a guess, try this:
=ArrayFormula(IF(ROW(A:A)=1, "Total Taxable Cash", IF(F:F="",,F:F-(C:C+D:D+E:E))))
I've written out some inefficiency and redundancy. But the key change is just swapping your SUM(C2:E2) with (C:C+D:D+E:E).

Match 3 cells pair with other 3 cells pair. Google Sheets

I'm using Google Sheets for our production price calculation and we are getting new orders with different data every week.
I have all the price calculations sorted out but sometimes there are the same data in orders that already been in the past and I have to manually search for it and use the same price if it exists.
As you can see in the example above, when I enter in the selected cell data "100", I have to check if it already exists in cells above (all three cell in the same row) and if it does enter its price on the cell on the right("=" sign), if it doesn't it could say "new" or be left empty.
I looked at the INDEX and MATCH functions but they don't seem to do the trick.
Do you have any suggestions? Of course the formula should be easily copied to every next cell down when new data and orders come in.
Approach
In this case it's useful to have an index for your table. I created a simple one that concatenates the 3 values you have with the & operator. You can see in the table below for the complete formula. Just drag it down to the whole table to make it automatic.
For the price calculation then I am using a VLOOKUP. It will search for the index generated by the three values in the new row and get the corresponding Price if ti exists. If not, it will print NEW. That's just a placeholder of course, you can edit it as you want. I put the first cell of your table as absolute reference in the VLOOKUP formula so you can drag it down and it will always get its upper (already filled) portion.
Table
INDEX X Y Z Price
11010030 110 100 30 1
500300100 500 300 100 2.3
12030010 120 300 10 1.2
500300100 500 300 100 2.3
12030010 120 300 10 1.2
11010030 110 100 30 1
3004510 300 45 10 NEW
11010030 110 100 30 1
=B10&C10&D10 =IFERROR(VLOOKUP(A10, $A$2:I9,5,0), "NEW")
Based on the correct initial thought by Alessandro, please use the following single arrayformula in cell E2
=ArrayFormula(IF(LEN(A2:A)>0,
IF(LEN(D2:D)>0,
VLOOKUP(A2:A&B2:B&C2:C, {A2:A&B2:B&C2:C,D2:D},2,0),"new"),""))
The formula works as a helper column, only showing you what price to use in column D (if it previously exists) or lets you know that you need to calculate a new one.
Functions used:
VLOOKUP
ArrayFormula
LEN
IF

running totals automatically inserted reset every 9 rows

I have a google sheet with 4 users use to log hours and other info in. The columns are totalised and displayed at the top.
What I would like to do is in a column, say L, number 1 - 9 every nine lines (rows) starting at row 6 (row number to be defined) and in another column, say M, insert the running total of the nine lines of the value in column I.
The reason for the running total is that it needs to be transferred in paper-based logbooks which have 9 lines per page.
Hope that makes sense?
How would you go about doing this and is it an equation or a macro I would need?
In the screenshot I would like to automatically add columns L and M. M is based on the value in I
L and M are the values under Page totals and I is the flight time.
test sheet
update 1: I have solved the counting with the following in L7 and then dragged down
=if(L6+1 < 10, L6+1,1)
Update 2: nearly working using the below in M7 and dragging it down, however, when column I is blank it still adds a number instead of leaving the cell blank!
=if(L7=1,
I7,
if(ISBLANK(I7), " ", M6+I7)
)
Formulae:
For column L, you can use an ARRAYFORMULA with the MOD operator, paste the following into L6:
=ARRAYFORMULA(MOD((ROW(L6:L) + 3),9) + 1)
For column M, use L7 = 0 instead of ISBLANK(L7), paste this in M6 and drag down:
=IF(L6 = 1, I6, if(I6 = 0, " ", M5 + I6))

FastReport 4 VCL, Summary of each unique detail row on last page

First there is a normal master-detail report, but in the end on a new page I want to summary fields on M and then a summary the values for each detail row.
(There is multiple fields to be summarized for both M and D).
**M1: 100**
D1: 11
D2: 12
D3: 13
**M2: 110**
D1: 21
D2: 22
**M3: 120**
D1: 31
D2: 32
<page2>
ReportSummary = H <summary of all M = 330 (100+110+120)>
<??Band??>
D1 <summary of all D1 = 11+21+31>
D2 <summary of all D2 = 12+22+32>
D3 <summary of all D3 = 13>
I have found that creating a second page and using a ReportSummary I can solve the last Master summary part.
But how can I get the last page Detail/Row summary for each unique detail?
Why don't you put a second MasterData connected to your Dataset on that second page, and GroupBands to summarize items.
Basically you would do a second loop on your data, just to summarize data instead of listing it.
PS: Your report can have as many MasterData bands as Datasets you want to report, and reporting two times the same dataset shouldn't be a problem either.

Formula to condtionally sum an array of values from one sheet to give totals on another

I have two sheets, connected by ID, which contain details of events and charges.
Sheet1 (breakdown of charges):
[Oh, just discovered I'm not allowed to include screen shots. I apparently need 10 reputation points. Not sure how to show you my spreadsheet now...]
ID DBF PCC Extras
1 200
1 100
3 200
4 350
4 250
4 75
4 25
7 100
[Sorry this will probably look horrible, I can't figure out how to include a spreadseet snippet without using an image. I had 3 imaage all prepared ready.]
Sheet2 (indentification and summary information):
ID Type Name
3 MON Edwards
7 REC Smith
4 WDG Jones
1 FNL West
8 WDG Richards
9 WDG Morrison
11 INT Gray
I am trying to add three additional columns to sheet 2 so that it shows a summary of the charges for each event. I would the charges information to update automatically in sheet2 as detail is added to sheet 1.
The resulting sheet2 will look like this:
ID Type Name DBF PCC Extras
3 MON Edwards 200
7 REC Smith 100
4 WDG Jones 350 250 100
1 FNL West 100 200
8 WDG Richards
9 WDG Morrison
11 INT Gray
As data for ID 8, 9 and 11 is added to sheet1, the summations should automatically appear in sheet2.
I have been trying to create an array formula to put in sheet2:B2, something like this:
=QUERY('Log Items'!A:F, "select sum(C), sum(D), sum(E), sum(F) where A="&A:A, 0)
This produces the correct result for ID 1 but it stops there and I'm not sure why. Also, despite my 0 as the third parameter, the header row is output.
I tried encapsulating the above in an ARRAYFORMULA but get a parse error.
I have also tried various combinations of ARRAYFORMULA, SUM and IF but not got anything that works. For example:
=ARRAYFORMULA(SUM(IF('Log Items'!A:A=A:A,'Log Items'!C:E,0)))
This gives #N/A "argument out of range", which I don't understand.
Although I've been working with Excel for a while, I'm really new to Google's Array formulas but have mananged to use them successfully in other parts of my spreadsheet and found them really powerful.
If anyone could help me with this, I would be very grateful.
In Sheet2!D2:
=ARRAYFORMULA(IF(A2:A,MMULT(N(A2:A=TRANSPOSE('Log Items'!A2:A)),N('Log Items'!B2:D)),))
Note: the N() functions have become necessary with different coercion behaviour in the new version of Sheets. They can be omitted in the classic version.
MMULT usage

Resources