Spreadsheet check IF-AND is not working when arrayformulaed - google-sheets

I have this formula
=ArrayFormula(if(AND(Input!A10:A=TRUE,Input!B10:B<>""),Input!C10:C & "_cn+" & Input!E10:E & "_ag+" & Input!G10:G & "_mu",""))
referring to these cells
I'm expecting the second row to contain text, but that's not the case.
Spreadsheet

use:
=ArrayFormula(IF((Input!A10:A=TRUE)*(Input!B10:B<>""),
Input!C10:C & "_cn+" & Input!E10:E & "_ag+" & Input!G10:G & "_mu", ))

Related

How to use the sum function when already using an indirect function in googlesheets?

=SUM((INDIRECT("'Week " & ROW()-6) & "'!$AH$28"),(INDIRECT("'Week " & ROW()-6) & "'!$AI$28"))
What I'm trying to do is:
Find a sheet name that has "Week" and "[number]" in the sheet name. (the number is the current row -6)
On that sheet found, I then want to sum up a range between cells AH28 and AV28. (I thought maybe it could work by manually adding the indirect part and the new cell number)
I'm pretty certain step 1 works, as I use a similar code/function in another sheet.
Am I not using the SUM part of the function right?
Do you know why this isn't working please?
Thank you!
=SUM((INDIRECT("'Week " & ROW()-6) & "'!$AH$28"),(INDIRECT("'Week " & ROW()-6) & "'!$AI$28"))
I get a #REF error saying that parameter "Week 2" is not a valid cell/range reference.
Alternatively, I could use =IFERROR(SUM('Week 1'!$AH$28:$AV$28),""), but I'm trying to avoid changing the week number of the sheet name manually many times.
I don't know how your data is structured. But if you are currently referring correctly to each cell, use SUM as you would with tho cell references, with ":"
=SUM(INDIRECT("'Week " & ROW()-6 & "'!$AH$28"):INDIRECT("'Week " & ROW()-6 & "'!$AI$28"))

Autofill Google Sheet rows with a formula

I need to combine multiple cells in Google Sheets and have it autofill as new rows are populated. I tried using the ARRAYFORMULA, however it does not update the new cell reference. It only copy/pastes the first row formula and applies to the rest of the rows. Please see attached image for reference.
So I need to combine columns B, C & D in column A, while the formula in column A should dynamically reference the new row. Here's the formula used:
=ARRAYFORMULA(IF(ISBLANK(B:B),"",IF (B:B <> "",concatenate(text(B1,"yyyy-mm-dd") & C1 & D1 & E1),"COMBO")))
In the formula above, is there a way for values B1, C1, D1 to dynamically update to C2,D2, etc,...?
Thanks!
Just like mentioned in the comments, you can use FILTER and use this formula
=FILTER(TEXT(B:B,"yyyy-mm-dd") & "" & C:C & "" & D:D & "" & E:E,B:B<>"")
Furthermore, you can read more about the FILTER function by checking this link:
FILTER Google Sheets;
previous answer can be simplified to just:
=FILTER(TEXT(B:B, "yyyy-mm-dd")&C:C&D:D&E:E, B:B<>"")
otherwise, if you want to use your formula:
=ARRAYFORMULA(IF(B1:B="",,TEXT(B1:B, "yyyy-mm-dd")&C1&D1&E1, "COMBO")))
or:
=ARRAYFORMULA(IF(B1:B="",,TEXT(B1, "yyyy-mm-dd")&C1:C&D1:D&E1:E, "COMBO")))
or:
=ARRAYFORMULA(IF(B1:B="",,TEXT(B1:B, "yyyy-mm-dd")&C1:C&D1:D&E1:E, "COMBO")))
or:
=ARRAYFORMULA(IF(B1:B="",,TEXT(B1, "yyyy-mm-dd")&C1&D1&E1, "COMBO")))

How do you find the difference between one cell in a column and the last non-empty cell in the same column in Google Sheets?

I am very inexperienced with spreadsheets and can only do very basic functions and formulas. My friends and I are tracking our weight loss over the next couple of months, so we're adding our weighs daily. I'm looking for a formula where I can find the difference between our starting weights (mine begins in G8) and the most recently entered weight (my last entry will be in G67). To clarify, I would like to keep track of my progress as I go, not simply the difference between the first and final entries.
I've researched this question quite a bit, but seem to only be able to find answers for Microsoft Excel (which didn't work for Google Sheets).
I've included a link to a test spreadsheet, so you can see what ours looks like: https://docs.google.com/spreadsheets/d/1RRMsauNAnC8PVjP5ieuHQUDawN33ybzSioajfQxwf_w/edit#gid=0
You can do like this:
=arrayformula(
{"Begin", B8:H8;
"Last", {
indirect("B" & max(filter(row(B8:B67),B8:B67<>""))),
indirect("C" & max(filter(row(C8:C67),C8:C67<>""))),
indirect("D" & max(filter(row(D8:D67),D8:D67<>""))),
indirect("E" & max(filter(row(E8:E67),E8:E67<>""))),
indirect("F" & max(filter(row(F8:F67),F8:F67<>""))),
indirect("G" & max(filter(row(G8:G67),G8:G67<>""))),
indirect("H" & max(filter(row(H8:H67),H8:H67<>"")))}
;"Different",{B8:H8}-{
indirect("B" & max(filter(row(B8:B67),B8:B67<>""))),
indirect("C" & max(filter(row(C8:C67),C8:C67<>""))),
indirect("D" & max(filter(row(D8:D67),D8:D67<>""))),
indirect("E" & max(filter(row(E8:E67),E8:E67<>""))),
indirect("F" & max(filter(row(F8:F67),F8:F67<>""))),
indirect("G" & max(filter(row(G8:G67),G8:G67<>""))),
indirect("H" & max(filter(row(H8:H67),H8:H67<>"")))}})
And you must continue to additional columns after column H (include change B8:H8 to B8:~8), and if any additional row you must change number row 67 to next future Last Row number of your data
or
=arrayformula({
{"Stage";"First";"Last";"Diff"},
{B7:H7;
B8:H8;transpose(
query(split(
query(transpose(
query(text(row(A8:A66)*not(isblank(B8:H66)),"0000") & ":" & B8:H66,
"Select " & join(",","max(Col" & column(B7:H7)-COLUMN(B7)+1 & ")"))
),"Select Col2"),":",true,false),"Select Col2"));
B8:H8-transpose(
query(split(
query(transpose(
query(text(row(A8:A66)*not(isblank(B8:H66)),"0000") & ":" & B8:H66,
"Select " & join(",","max(Col" & column(B7:H7)-COLUMN(B7)+1 & ")"))
),"Select Col2"),":",true,false),"Select Col2"))
}})

How to include JOIN in IF statement in Google Sheets

I have the following formula:
=ArrayFormula(
if(B1=""," ",
IF(C1=" ","NONE",
IF(AND('FORM'!$N:$U=B1,'FORM'!$N:$U=C1),'FORM'!$Z:$Z,
"OK"
)
)
)
)
For the most part it seems to be working but the second part of the statement "IF(AND" I need to join B1 and C1 and search for that joined string in FORM! N:U.
How do I add the JOIN operator in here?
Demo file
You can use the & operator instead - by doing B1&C1 -
also there are a few other corrections I would suggest about your formula because some of doesn't make sense - I am happy to do that if you can share some sample data because it is impossible to guess what you are trying to achieve.
Ended up using a different solution to my challenge.
See question/answer here: Google Sheet Query stopped working as expected
Thanks for all the help offered.
If i understood your question, you basically just switched if & and + and should be the sign. so -> & if()
I made a simple one here. I don't know how to make it more simple, but maybe with some VLOOCKUP?
Just change HVIS => IF (mine is danish)
Preview on my ark
codes:
=HVIS(B1>0;A1;) & HVIS(B2>0;A2;) & HVIS(B3>0;"-A3";)
& HVIS(B4>0;A4;) & HVIS(B5>0;A5;) & HVIS(B6>0;A6;)
& HVIS(B7>0;A7;) & HVIS(B8>0;A8;)
=HVIS(B11>0;A11;) & HVIS(B12>0;("-" & A12);)
& HVIS(B13>0;("-" & A13);) & HVIS(B14>0;("-" & A14);)
& HVIS(B15>0;("-" & A15);) & HVIS(B16>0;("-" & A16);)
& HVIS(B17>0;("-" & A17);) & HVIS(B18>0;("-" & A18);)

How do I find the average of only a partial range using Google Sheets?

I'm trying to find the average (excluding min and max values) of a range of date in Google Sheets. The problem is that the range will continue to grow.
I have the formula to drop min and max from the range1, but I need help figuring out how to calculate this formula based on only the last X entries in range1.
Drop min & max:
=(SUM(A1:Z1)-MAX(A1:Z1)-MIN(A1:Z1))/(COUNT(A1:Z1)-2)
In this sample doc I need to calculate the average of only the last 8 entries (while dropping the high and low values), to determine a rolling 6 month average. New entries will be input each month.
Try this:
=(SUM(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2)))) - MAX(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2)))) - MIN(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2))))) / (COUNT(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2))))-2)
OR
=AVERAGEIFS(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2))),INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2))),"<>"&MAX(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2)))),INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2))),"<>" & MIN(INDIRECT(ADDRESS(2,MATCH(1E+99,2:2)-5) & ":" & ADDRESS(2,MATCH(1E+99,2:2)))))
You can replace the - 5 in four places with a cell value, for example if you want more or less than the last 6 months, you could put the number of months desired in a cell say A3. Then replace the 5 with A3-1.
The basic building block is the MATCH(1E+99,2:2) which will find the last cell in row 2 with a number. So using that I used the ADDRESS() function to return the beginning and ending cell addresses with INDIRECT().

Resources