I have the following function
=IF(A2 <=10 , "YES","NO")
And if I want to apply for the entire column I have to drag this formula down. However, I wish to make it automated. The following formula doesn't work
={"New column";arrayformula(IF(A2 <=10 , "YES","NO"))}
Is there any way that I can make this formula automated for the entire column?
The argument of arrayformula should have an array somewhere. For example: A2:A instead of A2.
={"New column"; arrayformula(IF(A2:A <=10 , "YES", "NO"))}
Related
=OFFSET(INDIRECT($A$4),5+row()-2,4,1,1)
I'm looking to repeat the above formula in all row within the same column, so the calculation will change based on the row(). I tried to put it like below, column H is where the result will be going. But the row() is not following, all result are just using the formula row instead. The $A$4 is a where I'm using to input the range name.
=ARRAYFORMULA(D3:D&OFFSET(INDIRECT($A$4),5+row()-3,4,1,1))
I know I can drag it down, but automatic is always better. Before I'm over complicating the formula, is there a simple solution to make this work?
Updates:
Sample sheet link
https://docs.google.com/spreadsheets/d/1di8a9I0Fv-vuQFDNfV3sPsnWbDuBWTNDYlvUAI5pOCk/edit?usp=sharing
I've added a new sheet ("Erik Help") with two formulas, each of which will return the same results:
=IFERROR(OFFSET(INDIRECT("CLASS_"&$A$4),5+row()-3,4,COUNT(INDEX(INDIRECT("CLASS_"&$A$4))),1),"NO DATA")
-or-
=IFERROR(QUERY({INDEX(INDIRECT("CLASS_"&$A$4),,5)},"Select * WHERE Col1 Is Not Null",0),"NO DATA")
The D3 formula is better, because it is not dependent on the row where the formula is found (i.e., it can be placed anywhere and get the same result). It is "cleaner" (i.e., it has no redundancy of the INDIRECT clause). It's also easier to read and edit if necessary.
I have two sheets in my spreadsheet, I'm trying to get some columns from the first sheet into the second one and clean the data at the same time.
I've tried using:
ARRAYFORMULA(CLEAN({sheet1!A:A, sheet1!E:E}))
{ARRAYFORMULA(CLEAN(android!A:A)), android!E:E}
No error is shown, but the data is not cleaned, what am I doing wrong?
try:
=INDEX({CLEAN(android!A:A), CLEAN(android!E:E)})
or:
=INDEX(REGEXREPLACE({android!A:A, android!E:E}, "\s", ))
It seems that CLEAN formula together with arrayformula can work only with one column or row.
There are two ways to workaround.
First:
You can put these 2 columns one on another and use CLEAN formula and ARRAYFORMULA.
You should use a semicolon between ranges {sheet1!A:A ; sheet1!E:E}
The other method is to use all formulas twice in 2 columns
={ARRAYFORMULA(CLEAN(android!A:A)),ARRAYFORMULA(CLEAN(android!E:E))}
I recently noticed a mistake in my calculation, and I've identified the root cause of the problem: it seems that I mistakenly used the SUMIF function in Google Sheets' ARRAYFORMULA.
I have the sample spreadsheet here.
I wrote the ARRAYFORMULA function that results in column C, which I thought would be the same with the formula in column B.
The formula in column C:
=ARRAYFORMULA(SUMIF(H$3:H$6&I$3:I$6,"<="&A3:A31&">="&A3:A31,G$3:G$6))
The formula in column B:
=SUMIFS(G$3:G$6,H$3:H$6,"<="&A3,I$3:I$6,">="&A3)
In essence, I want to get the value for each date based on predefined values with their own periods.
Please, use this formula in the cell C3:
=ARRAYFORMULA(MMULT(IF((A3:A31>=TRANSPOSE(H3:H5))*
(A3:A31<=TRANSPOSE(I3:I5))=1,TRANSPOSE(G3:G5),0),ROW(G3:G5)^0))
I made a new tab called MK.Help and erased all the other formulas. then i put this formula in C3:
=ARRAYFORMULA(ARRAY_CONSTRAIN(MMULT(N(A3:A>=TRANSPOSE(A3:A)),MMULT((A3:A>=TRANSPOSE(H3:H))*(A3:A<=TRANSPOSE(I3:I)),N(G3:G))),COUNTA(A3:A),1))
Does that work for you?
I'm trying to embed a countif into an array formula in Google Sheets. I'm using the countif command to count the number of cells on another page with a given text string, stored in column B. Column B just contains a list of titles. The concatenate portion does a general keyword lookup.
Here is the formula that does not work. It just returns a 0 in each cell, which tells me the countif statement is failing.
=arrayformula(IF(B2:B<>"",COUNTIF(Registrations!C:C,(CONCATENATE("*", B2, "*"))),""))
If I pull out the countif statement, it works fine by itself.
=COUNTIF(Registrations!C:C,(CONCATENATE("*", B2, "*")))
I have even tried referencing B2:B in place of the B2 cell reference, but that does not work. What did I do wrong in the array formula statement?
Have you tried using & instead of the CONCATENATE function and referencing to B2:B in place of only B2?
The formula should look like this:
=arrayformula(IF(B2:B<>"",COUNTIF(Registrations!C:C,("*" & B2:B & "*")),""))
It works for me.
This is my 'Registrations' sheet:
And this is the sheet where the formula is written:
Based on this sample data, I have this formula which gives me the accurate results with one major problem... It does not auto-populate to new rows
=arrayformula(if(countif(filter(G$2:G,A$2:A=A2,B$2:B=B2),">"&G2)>0,countif(filter(G$2:G,A$2:A=A2,B$2:B=B2),">"&G2),COUNTIF(filter(E$2:E,A$2:A=A2,B$2:B=B2),"Finished")))
I have tried this formula to see if it will auto-populate to the new rows...
=arrayformula(IF(ISNA(A2:A),,if(countif(filter(G$2:G,A$2:A=A2,B$2:B=B2),">"&G2)>0,countif(filter(G$2:G,A$2:A=A2,B$2:B=B2),">"&G2),COUNTIF(filter(E$2:E,A$2:A=A2,B$2:B=B2),"Finished"))))
...the above formula does auto-populate; however, every value is 1 instead of the correct value.
I tried a simple formula which does not do everything the above does but might help troubleshoot. I was under the suspicion that the above formula was only displaying results of the first row over and over. To test I tried this formula...
=arrayformula(IF(ISNA(A2:A),,indirect("g"&ROW(indirect("g2:g"&counta(G2:G))))))
...it turns out that the above formula does display the results from G2 into each row. If I could figure out the reason why, I am sure I could take the concept from the solution to this simple formula and add it to the above more complex one.
Please, try this formula:
=ArrayFormula(if(
mmult(
--(A2:A=TRANSPOSE(A2:A))*
--(B2:B=TRANSPOSE(B2:B))*
--(G2:G<TRANSPOSE(G2:G)),
row(A2:A)^0)>0,
mmult(
--(A2:A=TRANSPOSE(A2:A))*
--(B2:B=TRANSPOSE(B2:B))*
--(G2:G<TRANSPOSE(G2:G)),
row(A2:A)^0),
mmult(
--(A2:A=TRANSPOSE(A2:A))*
--(B2:B=TRANSPOSE(B2:B)),
--(E2:E="Finished"))
)
)
Caution! It works slow, so it's better to delete blank rows in the worksheet. Even better to use this formula in 2 steps. Step 1 formula:
=ArrayFormula(mmult(--(A2:A=TRANSPOSE(A2:A))*
--(B2:B=TRANSPOSE(B2:B))*
--(G2:G<TRANSPOSE(G2:G)),
row(A2:A)^0))
And step 2 formula:
=ArrayFormula(mmult(--(A2:A=TRANSPOSE(A2:A))
*--(B2:B=TRANSPOSE(B2:B)),
--(E2:E="Finished")))
Open ranges overload this formula. It also could work faster if you use:
offset(E2,,,counta(E2:E)) instead of E2:E