Google Sheet SUMIF across range of cells - google-sheets

I am trying to use a formula in google sheets to find averages based on the contents of a different cell.
Below is some sample data, I am pretty sure I have done similar in the past in Excel by using table headers as a reference but struggling to see how to achieve this in google sheets.
Columns B, C, D to be calculated, currently this is the formula used for D3 (same sort of thing for D4) =IFERROR(ROUND(SUM(E3:H3)/COUNT(E3:H3),2),0)
Just needing to work out the formula for the cells with red text, any help would be appreciated.
as an example C3 would be the average for any numbers in row 3 where it has DeviceB e.g. (2+10+6)/3

Try
=AVERAGEIF($E$2:$H$2,B$1,$E3:$H3)
AVERAGEIF

Related

How can I concatenate and transpose two ranges of cells in Google Sheets?

I have a Google Form linked to a Google Sheet. It has a number of questions with responses that I need grouped into specific columns. I also need to keep the columns in the order they're in.
I was working with a formula someone helped me with to do one single range:
=ARRAYFORMULA({"Job Responsibilities";IF(A2:A="",,TRIM(TRANSPOSE(QUERY(TRANSPOSE(H2:V),,100))))})
However in the instance I am having problems, I need to group together the answers that are in columns W - AK and also BA - BO into one cell.
I tried something like
=ARRAYFORMULA({"Supporting SAP Stream";IF(B2:B="",,TRIM(TRANSPOSE(QUERY(TRANSPOSE(W2:AK)TRANSPOSE(BA2:BO),,100))))})
or
=ARRAYFORMULA({"Supporting SAP Stream";IF(B2:B="",,TRIM(TRANSPOSE(QUERY(TRANSPOSE(W2:AK, BA2:BO),,100))))})
But that makes an error.
Is there another modification I can make to concatenate and transpose the values in these cells?
Here is a link to a Google Sheet showing most of what I'm referring to. It's from an earlier iteration, so it's not 100% exact with what I said above, but the goal is still the same. In this Sheet, I would like to concatenate what's in Columns U - AG and AU - BF.
Update, based on the data in your sheet:
=ARRAYFORMULA({"Supporting SAP Stream";IF(B2:B="",,TRIM(TRANSPOSE(QUERY({TRANSPOSE(U2:AG);TRANSPOSE(AU2:BG)},,100))))})
Try:
=ARRAYFORMULA({"Supporting SAP Stream";IF(!B2:B="",,TRIM(TRANSPOSE(QUERY({TRANSPOSE(W2:AK); TRANSPOSE(BA2:BO)},,100))))})

Google Sheets: How set value from two matched columns?

i'm trying to transform data from a row only list to a row-column structure.
I got data in I:K and want to set the values from K to the corresponding cells in A:H where Date and Time Values from I & J have to match within A:H.
example sheet
Does anyone know how to do this with Google Sheet system functions?
Yes, it can be achieved by using sumifs formula, simple and straightforward, here is the formula:
=SUMIFS($I$2:$I$13,$G$2:$G$13,$A5,$H$2:$H$13,D$1)
And this is how the Gsheet look like, accept if helping you :)

Google Sheets: Use ArrayFormula for JoinText for multiple columns

I want to Use ArrayFormula for JoinText for multiple columns which have their own ArrayFormulas in Google Sheets.
My formula works for columns that have plain text values but for some reason Google Sheets gives me an error when I apply it to columns that have their own ArrayFormulas applied to them.
Take a look at the example sheet I've created HERE
Any help will be appreciated!
I hope this solution with query is helpful for you:
=ArrayFormula(transpose(query(transpose(C1:D),,2)))
(Will work faster if you know the limit of the range, e.g. C1:D10).
For implementing commas between the columns you can use
=ARRAYFORMULA(IF(C1:C="",D1:D,if(D1:D="",C1:C,C1:C&", "&INDIRECT("D1:D"))))
I put this formula in cell I2 on your sample sheet. It should be relatively fast for many thousands of rows.
=ARRAYFORMULA(SUBSTITUTE(TRIM(C2:C&CHAR(10)&D2:D),CHAR(10),", "))

Google Sheets, Is it possible to use Arrayformula to expand formulas downward when the formula uses arrays

I've been using Arrayformula to auto-expand formulas (such as "=Left(A2:A,B2:B-1") downward, but I need some help understanding this formula. I've read up on the function itself and browsed many forums about this but I can only find articles explaining how to use this with simple formulas, so I'm going to try to as this as simply as possible here: Is it possible to use Arrayformula to expand formulas downward when the formula uses arrays?
The summary for Arrayformula reads "Enables the display of values returned from an array formula into multiple rows and/or columns and the use of non-array functions with arrays." This was my understanding of how Arrayformula populated a formula into rows automatically. Using this I thought of it as writing a formula that generated an array of formulas, and then splitting them up with Arrayformula. This seems to not work with some formulas such as concatenate, which I will focus my question on. This example is far from my real life problem, but if someone could show me a solution I can apply it elsewhere.
Arrayformula spreadsheet example
Usually when I use Arrayformula with A1:A it would expand the formula through the column, referencing the corresponding rows as it went. With this example I want to have Column C be the concatenated result of columns A and B. Is this possible with Arrayformula? This question is not specific to concatenate, that is just the simplest one that came to mind. Another example would be Countif. Lets say I want to see how many values in the first 5 columns are over 20, and I want that formula to auto populate down, is that possible and if so how would it be done?
Arrayformula second example
P.S. Please don't say copy the formula using the drag handle in the lower right.

Google Sheets: Formula in an Array in a Formula

I'm trying to find a way to consolidate formulas into 1 cell. As of right now i have 2 mildly complicated formulas using up multiple columns.
I'm trying to put the formulas as an array in a single cell.
To avoid confusing the matter, i've only included a simplified version of the formulas and only using 1 column.
Edit:
Here is the Spreadsheet in question, the Better Mobs sheet
Ok, so i tried to implement the solution and it didn't work the way i needed. Before i consolidate and just use 1 spreadsheet, the full formula in cell F1 is:
=match(max(F2:F),F2:F,0)+1&" - "&INDIRECT("A"&match(max(F2:F),F2:F,0)+1)
and cell F2 is:
=IFERROR(E269/ROUNDUP($C269/MAX(0,importrange("1rkS5zujl6oo66JNbhb8yWOjgOqRoXhvyGa-nr95krJ4","Damage Reward!$B$26")/2-$K269)*MAX((MIN(100+sqrt(importrange("1rkS5zujl6oo66JNbhb8yWOjgOqRoXhvyGa-nr95krJ4","Damage Reward!$B$27"))-sqrt(O269)-MAX($B269-importrange("1rkS5zujl6oo66JNbhb8yWOjgOqRoXhvyGa-nr95krJ4","Damage Reward!$B$3"),0)*5,100)/100),0)*2),"")
Does this formula work as you want in cell C1:
={MAX(ArrayFormula(IFERROR(B2:B*D2:D/E2:E)));ArrayFormula(IFERROR(B2:B*D2:D/E2:E))}

Resources