Adding values based on other values but SUMIF is quite right - google-sheets

Here is a link to my spreadsheet. Essentially what I am looking for is if the task matches then I want to also be able to give a Tech level then from there add up the values. I put a note in the sheet but basically if I give a task value and a tech level I want the corresponding value but whenever I try to do multicolumn adding in my sumif it just gives me the value from the first column.
An example of the formula I want is something like =SUMIF(Name, Name2 and Rank, Add Values).

try:
=INDEX(IFNA(VLOOKUP(K3:K&"♥"&L3:L, SPLIT(FLATTEN(
IF(B2:D="",,A2:A&"♥"&B1:D1&"×"&B2:D)), "×"), 2, 0)))

I think what you are looking for can be done by using a Index-Match function.
e.g. If you paste the following formula in an empty cell somewhere in the sheet,
=INDEX($A$1:$D$8, MATCH("Task 1",$A$1:$A$8,0),MATCH("Tech 2",$A$1:$D$1,0))
it gives you 20 corresponding to Task 1 and Tech 2.
If you paste the following in an empty cell somewhere in sheet,
=INDEX($A$1:$D$8, MATCH("Task 7",$A$1:$A$8,0),MATCH("Tech 3",$A$1:$D$1,0))
it gives you 36 corresponding to Task 7 and Tech 3.

Related

How to return nth value from one Column based on another Column using ArrayFormula or QUERY?

I'm working with a long, growing list of ratings data, and I'm trying to find a way to reference the 2nd (3rd, 4th, etc.) rating.
Here's a link to the sheet I'm working on.
The data I want to reference is in F5:H. I'm using QUERY to show most of the info I want (see A5 in my sheet for this formula), but where I'm running into trouble is when I try to retrieve only the Nth rating from Column H for a particular client based on the Client in Column A.
I'm sure I'm missing something obvious... the biggest (potential) limitation is that I need a formula that I can put in D5 that auto-fills this info for the entire column.
Thanks in advance!
try:
=ARRAYFORMULA(IF(A5:A="",, IFNA(VLOOKUP(A5:A,
FILTER(G5:H, COUNTIFS(G5:G, G5:G, ROW(G5:G), "<="&ROW(G5:G))=2), 2, ),
VLOOKUP(A5:A, G5:H, 2, ))))

How to seach column for all text matches in column A and sum all of the corrosponding values in column B Excel

I'm sure this is possible, but I've been trying various ways for the past 2 hours and can't find the solution.
I need to find all the instances of a text name in column A, lookup all the numerical results in column B and sum them together.
I thought =ArrayFormula(sum(lookup(F2,$A$2:$B$1000))) would do the trick, but it's only picking up the last value on the last mention and not all the values of all the mentions.
I've attached a spreadsheet to show the data I'm looking at.
Thanks to the reference from BigBen to check out Sumifs. Using this command, the following works a treat:
=SUMIFS(B2:B3115,A2:A3115,F2)
try:
=QUERY(A2:B; "select A,sum(B) where A is not null group by A label sum(B)''")

Can de search key of MATCH be a row of values?

I am would like to use the values in the name column (search key) and look them up in a table with the headers [name, regular, overtime].
The formula I am using is:
=ArrayFormula(index(rateTable, match(formName,workers,0),match(formType,rateTypes,0),0)*{formHours})
It works except the search key in the MATCH formula, does not reference every respective entry in the name column, but only works with one fixed reference to a cell.
Am I trying to use this formula beyond its capabilities? I'd like to know if I should stop searching. Thanks.
Here is a link to a copy of my sheet:
https://docs.google.com/spreadsheets/d/1sovuTB4zSTpl0RUHciYltr-pf8g4KPTgkYVE5lB4Ifk/edit?usp=sharing
=ArrayFormula(index(rateTable, match(formName,workers,0),match(formType,rateTypes,0),0)*{formHours})
for this task is best if you use VLOOKUP formula. paste in I2 cell:
=ARRAYFORMULA(IF(LEN(formName), IFERROR(VLOOKUP(formName, rateTable,
IFS(formType="Regular", 2,
formType="Overtime", 3), 0)) * formHours, ))
demo spreadsheet
INDEX doesn't work with arrays as needed for ARRAYFORMULA. Either…
use copied formulas rather than a single ARRAYFORMULA, e.g.
=IF(NOT(LEN(A2)),"",index(rateTable, match(C2,workers,0),match(G2,rateTypes,0))*H2)
and drag-copy it down column I,
or refactor your INDEX(,MATCH( use to rely instead on VLOOKUPs and HLOOKUPs.

Google Sheet - Transform two columns into one column using arrayformula (more than 50,000 characters)

I'm using Google Sheets and looking for an arrayformula that able to take a list in two columns and arrange it alternately in one column. The sheet contains about 5,000 rows, each row has more than 35 characters.
I tried this:
=transpose(split(join(" ", query(transpose(B5:C),,50000)), " "))
But then I got this message:
Please take a look at the sheet here:
https://docs.google.com/spreadsheets/d/11T1Roj1trviOSiiTZS292-4l3oODid7KLi9oGz3Z66o/edit#gid=0
Assuming your 2 columns are A and B, this formula will "interlace" them:
=query(
sort(
{arrayformula({row(A1:A3)*2, A1:A3});
arrayformula({row(B1:B3)*2+1, B1:B3})}
),
"select Col2")
Explanation, unwrapping the formula from the inside:
Each value gets a unique number, based on its row number times 2 (+1 for the 2nd column)
Everything is sorted based on this number
Only the 2nd column is extracted for the result.
There is a function for this called FLATTEN().
This works perfectly as a general solution since it takes an array of any size and outputs the items in the order they appear left-right-top-down (See here).
It can be combined with TRANSPOSE() to accomplish the same thing but in the horizontal case, and if needed blank cells can be omitted with FILTER().
EDIT:
My sincere apologies, I did not read the question carefully enough. My response is incorrect.
This should work:
={B5:B12;C5:C12}
just be careful to NOT change it to
={B5:B;C5:C}
This will start an infinite loop where the spreadsheet will increase the amount of rows in the spreadsheet to allow this output column to expand, but in doing so increases the length of the 2 input columns, meaning the length of the output column increases even more, so the spreadsheet tries adding more rows, etc, etc. It'll make your sheet crash your browser or something each time you try to open it.
In Row5:
=ArrayFormula(offset(B$5,INT((row()-5)/2),iseven(row())))
Would need to be copied down however.

Getting Corresponding Cell In Google Sheets?

I have a Google sheet for tracking my weight. I have two columns: Date and Weight. While the goal is to have the weight column sorted in descending order, that doesn't always happen in reality...
The data essentially looks like this (weights changed to far lower values, of course):
Date |Weight
04/01/10|195
04/02/10|194
04/03/10|190
04/04/10|198
etc.
Anyway, I have a cell in another spot on the sheet that shows the minimum value from the weight column using this formula
=(Min(B:B))
What I would like to do is display the corresponding date cell for whatever the minimum value from the weight column is. So, with this dataset, I want to show 190 for weight and 04/03/10 for date. Is there any way to get that corresponding cell? I looked through the function reference for Google docs, but can't get anything going. I tried using some of the functions from the Lookup category, but got nowhere. Most want a cell reference, but the min() function returns a value. I think I need to somehow get min() to give me a cell reference, but I don't know how to do that. HLOOKUP() sort of seemed like it might be appropriate, but the docs were a bit spotty, and it didn't do anything but error out the cell.
Of course, I may be barking up the wrong tree entirely.
Thoughts?
I would use the following two formula's:
MIN(B2:B)
FILTER(A2:A;B2:B=minimal value)
If there are more results, they need to be included as well.
See example file I've created: Getting Corresponding Cell In Google Docs Spreadsheet?
Not barking up the wrong tree, actually very close:
=index(A:A,match(min(B:B),B:B,0))
should meet your requirement.
Working inside out: min(B:B) (as you had) returns the lowest weight (ie 190) in ColumnB.
match then finds the position of that value relative to the start of the range in which the value is searched for. So assuming Date is in A1, that returns 4, being the fourth row in ColumnB, where 190 is. The 0 in the formula is to ensure that only the position of an exact match is returned.
Now we know we need the content of the fourth row we can go looking for the value there in ColumnA with index, returning 04/03/2010.
Not all is ideal however. It is possible that a weight of 190 was achieved on separate days. It is the nature of match that where an exact match is required and found the function stops looking for any further instances. Hence as things stand 04/03/2010 will be returned for 190 however often that is the weight for a day after 04/04/2010 - unless other steps are taken, such as to delete/remove/ignore data from 04/03/2010.
You need to change the order of the column as the search column (the weight should be the first in the search array. Then you can use the VLOOKUP formula:
=VLOOKUP(C7,A:B,2,false)
C7 holds the MIN formula that you used: =(Min(A:A)) - note the column order change
one-cell solution to get minimal value with the latest day:
={MIN(B:B), TO_DATE(VLOOKUP(MIN(B:B), SORT({B:B,A:A}, 2, 0), 2, 0))}
to get all minimal values with dates:
=QUERY(A:B, "select B,A where B matches '"&MIN(B:B)&"' order by A desc", 0)

Resources