I have a spreadsheet with a few sheets I reference with =INDEX. The code I use below works fine when I Paste as Formula to all the cells in a column.
=INDEX(DATABASE!A:A, MATCH('SMS FINAL'!C2:C, DATABASE!C:C, 1))
The code I am trying to use has ArrayFormula so that I only have to type the formula in once:
=ArrayFormula(
IF(ROW(E:E)=1,"Company",
IF(ISBLANK(E:E),"",
INDEX(DATABASE!B:B,
MATCH('SMS FINAL'!C:C, DATABASE!C:C, 1)
))))
This breaks the column and only leaves the "Company" in the header row. Any ideas?
try it like this:
=ARRAYFORMULA({"Company";
IF(ISBLANK(E:E), ,
INDEX(DATABASE!B:B,
MATCH('SMS FINAL'!C:C, DATABASE!C:C, 0)))})
or like this:
=ARRAYFORMULA({"Company";
IF(ISBLANK(E2:E), ,
INDEX(DATABASE!B:B,
MATCH('SMS FINAL'!C:C, DATABASE!C:C, 0)))})
Related
I'm building out a time tracking form and sheet.
I have everything working and I am able to get the next instance of a row that contains that user's name to get the elapsed time they were in that status.
The formula I am currently using is this:
=ArrayFormula(iferror(INDEX($A2:$A,SMALL(IF(B2=$B3:$B,ROW($B$2:$B)),1)), NOW()))
However, this does not work in an ARRAYFORMULA.
I've tried:
=ARRAYFORMULA(VLOOKUP(B2:B, {INDIRECT("B"&ROW(A2:A)+1&":B"), INDIRECT("A"&ROW(A2:A)+1&":A")}, 2, FALSE))
Which doesn't work in array formula because of INDIRECT.
=ARRAYFORMULA(SORTN(FILTER(A3:A, B3:B=B2), 1))
Doesn't work in ARRAYFORMULA
=ARRAYFORMULA(QUERY(A3:C, "SELECT MIN(A) WHERE B = '"&$B2&"' label MIN(A) ''"))
Doesn't work in ARRAYFORMULA.
These formulas all work if I drag them down manually but I don't want to have to open this sheet every couple of hours to drag it down.
Please help!
Link to sheet where I've been messing with formulas:
https://docs.google.com/spreadsheets/d/1ZZOFTFlhmanQPNfRreT2bBinlkb00uaK-qypmEMD3ww/edit
count it:
=ARRAYFORMULA(IF(B2:B="",,IFNA(VLOOKUP(
B2:B&COUNTIFS(B2:B, B2:B, ROW(B2:B), "<="&ROW(B2:B)),
{B2:B&COUNTIFS(B2:B, B2:B, ROW(B2:B), "<="&ROW(B2:B))-1, A2:A}, 2, 0), NOW())))
I have the following formula in google sheets which works perfectly in the row 3.
=ArrayFormula(if(len($A$3:$A),vlookup($A$3:$A,'All records in progress'!A2:BE,{57,6,7,8,9,10,11,13,14,31,32,33},FALSE),""))
However, I would like to have the formula in the row 2 with the header so I was trying to create something like this:
={"Header"; ArrayFormula(if(len($A$3:$A),vlookup($A$3:$A,'All records in progress'!A2:BE,{57,6,7,8,9,10,11,13,14,31,32,33},FALSE),""))}
So I could have the word Header in the first row and the formula from the next row onwards. However, my formula is not working. Do you know if how I could achieve this?
Looking forward to your reply.
Cheers,
your vlookup returns 12 columns so you need:
={{"Header","","","","","","","","","","",""};
ARRAYFORMULA(IF(LEN(A3:A),
IFNA(VLOOKUP(A3:A, 'All records in progress'!A2:BE,
{57,6,7,8,9,10,11,13,14,31,32,33}, 0)), ))}
I am trying to wrap the following formula in an array formula:
=IF(A3=0,,COUNTBLANK(E3:3))
I tried doing this:
=ARRAYFORMULA(IF(A3:A=0,,COUNTBLANK(E3:E:3)))
but get a formula error.
What is the correct way to do it?
you will need to do it like this:
=ARRAYFORMULA(IF((LEN(A3:A))*(A3:A<>0), COLUMNS(E3:3)-
MMULT(IFERROR(LEN(INDIRECT("E3:"&ADDRESS(ROWS(A1:A),
COLUMNS(A1:1),4)))/LEN(INDIRECT("E3:"&ADDRESS(ROWS(A1:A),
COLUMNS(A1:1),4))), 0), TRANSPOSE(COLUMN(E3:3)^0)), ))
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:
I know how sumif works when I need to access it within the same Google "workbook" (using the analogy from excel). By workbook I mean a collection of sheets, not sure whether there is a different way to refer to Google workbook.
For example in the sheet (Example 3): https://docs.google.com/spreadsheets/d/1Dm-N-1X38zHartE3JbPUtWDnYwEpkGHl6v06huvjSa8/edit#gid=0
I have Sheet2, with column A contain strings and column B containing numerical value. On sheet 1, I have a sumif function which can be query data stored in Sheet2, and sum the cells which match A1 in Sheet1.
The problem starts happening when I try to refer to ranges in a completely different workbook, which is shown below.
I am trying to do a sumif over 2 ranges from a different "workbook". The data is stored here (Example 2): https://docs.google.com/spreadsheets/d/1P5Inf09fLSRmsGbG7LwlE4V-r7DzqY0SB5tJuMKMZH0/edit#gid=0
The Sumif function is in Cell B1 of the following sheet (Example 1):https://docs.google.com/spreadsheets/d/1AitilELd6w7Dbv9d-mKhBYGTBaO6DdkU29Y5mofX2TI/edit#gid=0.
From my understanding importrange is typically used to refer to ranges in completely different workbooks, as a result I use importrange as the first and last arguments in the sumif function in the Sheet Example 1.
What am I doing wrong? Why is this not working?
Can anybody help?
Thanks a lot
See if this query does what you want:
=SUM(query( QUERY( Importrange("1P5Inf09fLSRmsGbG7LwlE4V-r7DzqY0SB5tJuMKMZH0","Sheet1!A1:B10") ) , "select Col2 where Col1 contains '"&A1&"'" ) )