Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 months ago.
Improve this question
I know there have been many questions regarding this and I did read through these (+ the answers). But the formula suggested in each of them does not seem to work for me.
I have created a sheet for other people to look at, so that you all understand what I have been trying to do. I basically want my VLookup to search for the first 5 characters, but it's giving me an error. I used the formula that was suggested here in some other threads, but it doesn't seem to give any results.
Any help is much appreciated.
Use left(), like this:
=arrayformula( if( len(A2:A); iferror( vlookup( left(A2:A; 5) & "*"; F2:G; columns(F2:G); false) ); iferror(1/0) ) )
This array formula will automatically fill the whole column.
To do the same with a fill-down formula, remove the arrayformula() wrapper and use a row absolute reference, like this:
=vlookup( left(A2; 5) & "*"; F$2:G; columns(F$2:G); false)
See your sample spreadsheet for an illustration.
try in C2:
=INDEX(IF(A2:A="";;IFNA(VLOOKUP(LEFT(A2:A; 5)&"*"; F2:G12; 2; ))))
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 months ago.
Improve this question
I am working on a school rooming timetable system. I am finding a formula which finds if a particular room is used during a specific period by which class and teacher.
There is a staff overview with clean data of which class and room they are in, alongside preferred results:
https://docs.google.com/spreadsheets/d/1H9Q8K9KBLgqCsvVZ_ekqsLPbZKeMzvldDnyI-KerOD4/edit?usp=sharing
For example, for on the overview, Monday Period 1 (Column B) Staff 1 uses room BG01 for the class 07MA01. Thus on the room overview, it shows that in Period 1, Staff 1 uses BG01 for 07MA01.
Use filter() and regexmatch(), like this:
=iferror(
textjoin( "; ", true,
filter(
regexreplace('Staff Overview'!B$3:B, "#.+", "") & "(" & trim('Staff Overview'!$A$3:$A) & ")",
regexmatch('Staff Overview'!B$3:B, $A3)
)
),
"FREE"
)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
i'm working on a schedule tool, but can't figure something out. I'd like to use the arrayformula function in Google Sheets. It should sum up two values from the previous row.
At the moment I'm using this, but i'd like to convert it into an arrayformula. I've tried several things, but end up with the 'Circular dependency detected' message.
=iferror(IF(REGEXMATCH(C5;"DAY");E5;index(G:G;ROW(G5)-1;1)+H6);index(G:G;ROW(G5)-1;1)+H6)
Here's the doc:
https://docs.google.com/spreadsheets/d/15jXayEN_vjK3nMRjLjaiLspT_rh_rBD_WX_LAZETRSU/
try:
=INDEX(IF(IFERROR(REGEXMATCH(C3:C; "(?i)DAY")); E3:E; SCAN(E3; H3:H; LAMBDA(x; y; x+y))))
Use the sumif(row()) pattern in cell G4, like this:
=arrayformula(
if(
isnumber(H4:H);
E3 + sumif(row(H3:H); "<=" & row(H3:H); H3:H);
iferror(1/0)
)
)
Format cell G4 as hh":"mm. You should turn off File > Settings > Calculation > Iterative calculation.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 months ago.
Improve this question
I had this formula working correctly in Excel, but when I'm trying to do the same in Google Sheets, it's not having it:
=TEXTJOIN(", ",1,FILTER(People2,ISNUMBER(SEARCH(People2,D2)),""))
I have used Exceljet, precisely as described here:
https://exceljet.net/formula/cell-contains-which-things
The formula tries to match words in my "dictionary" in People2 to words in cell D2, and lists all matching ones.
I have set up everything in name manager, works perfectly in Excel.
When I'm trying to do the same in Google Sheet, I get the following error:
FILTER has mismatched range sizes. Expected row count: 211, column count: 1. Actual row count: 1, column count: 1.
The only thing I'm doing differently is now I have the name range in a separate sheet.
I've found posts on how to fix this error, but none seem to apply to my scenario as my range is on a separate sheet.
Any ideas?
Using multiple cell formula
=ArrayFormula(IFERROR(TEXTJOIN(", ",,
TRANSPOSE(QUERY(TRANSPOSE(IFERROR(REGEXEXTRACT(IF(A2="",,SPLIT(A2," ")),{
TEXTJOIN("|",,QUERY({$D$2:$D}, "Where Col1 is not null"))}),"")),"where Col1 is not null "))),""))
Using Arrayformula
Note: for a simplified example checkout this question
=INDEX(REGEXREPLACE(TRIM(FLATTEN(QUERY(TRANSPOSE(IF(
IFERROR(REGEXEXTRACT(IF(A2:A="",,SPLIT(A2:A," ")),TEXTJOIN("|",,QUERY({$D$2:$D}, "Where Col1 is not null"))),"")="",,
IFERROR(REGEXEXTRACT(IF(A2:A="",,SPLIT(A2:A," ")),TEXTJOIN("|",,QUERY({$D$2:$D}, "Where Col1 is not null"))),"")&",")),,9^9))), ",$", ))
This question already has answers here:
ArrayFormula and "AND" Formula in Google Sheets
(4 answers)
Closed 4 months ago.
I have a IF statement with several AND conditions working great for my needs, however i want/need to transform it into an ARRAYFORMULA but i just cannot get it to work...
Working formula is this
=if(AM3="";"";
if(and(COUNTIF(AM3;"*"&X3&"*");J3<>"x");"Arrival";
if(and(J3="x";L3<>"x";if(COUNTIF(AM3;"*"&X3&"*");false;true));"Departure";"")))
NOT working ARRAYFORMULA is this:
=arrayformula(if(AM2:AM="";"";
if(and(J2:J<>"x";COUNTIF(AM2:AM;"*"&X2:X&"*")>0);"Arrival";
if(AND(J2:J="x";L2:L<>"x";if(COUNTIF(AM2:AM;"*"&X2:X&"*")>0;FALSE;TRUE));"Departure";"d"))))
Can someone help and explain me why it doesn't work pls?
Thanks.
AND is not supported under AF. try:
=INDEX(IF(AL3:AL="";;
IF(REGEXMATCH(LOWER(AL3:AL); LOWER(X3:X))*(J3:J<>"x"); "Send Arrival";
IF((J3:J="x")*(L3:L<>"x")*(IF(REGEXMATCH(LOWER(AL3:AL); LOWER(X3:X));
FALSE; TRUE)); "Send Departure"; ))))
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I'm building a google sheet to keep track of my money.
I'm pretty new to all this and I'm learning how to do a few things.
I'd like to build a table where I can have categories (in green) and their subcategories. So I'd like to be able to have the sum of the sub categories in front of their parent category.
Also, this is a template that is probably going to change over time, so I'd like it to be modular (it would be simple otherwise) if I add a new subcategory or even a new category.
Thanks for the help.
Here is what I have managed to find and edit, maybe it's a great path... =IF($A3="✹";SUM(E3:INDEX(E3:E;MATCH(TRUE;(A3:A="✫");3)));"")
But actually it sums every row that has a star in the "A" column. It doesn't stop until it meet a sun
here is the link to access the sheet
Also, I know that Aspire Budget works that way, but it's a bit too complicated and I need help to understand it...
try:
=SUM(IFERROR(INDIRECT(ADDRESS(IF(INDIRECT(ADDRESS(ROW()+1, 1))="✫", ROW()+1, "×"), 5)&":"&
ADDRESS(MATCH("✹", INDIRECT("A"&ROW()+1&":A"), 0)+ROW()-1, 5))))
Here is a function that works:
=
if(
indirect("A"&(row()+1))="✫",
sum(
indirect(
"E"&(row()+1)&":E"&vlookup(
"✹",
{
indirect("A"&(row()+1)&":A"),
arrayformula(row(indirect("A"&(row()+1)&":A")))
},
2,
FALSE
)-1
)
),
0
)
The basic idea is to search for the next ✹. Then get the range between the two rows ad add them.
Formula rundown
Step 1: Get the values starting after this row
This can be done using indirect. Basically it's A<next row>:A.
The number of row it's simply row(); and the next one row()+1.
So using indirect we get:
=
indirect("A"&(row()+1)&":A")
Step 2: Find the next category
We want to have the number of the next category. This can be achieved using vlookup.
What we do is make an array with the value on the first column and the number of column on the second one. To get the number of row of a value row can be used. So it would like:
{
<range>,
arrayformula(row(<range>))
}
We need arrayformula to make sure it's used as a formula.
<range> would be the value on the last step so together it looks like:
=
{
indirect("A"&(row()+1)&":A"),
arrayformula(row(indirect("A"&(row()+1)&":A")))
}
Now we need to add the vlookup:
=
vlookup(
"✹",
{
indirect("A"&(row()+1)&":A"),
arrayformula(row(indirect("A"&(row()+1)&":A")))
},
2,
FALSE
)
Which is basically getting the value of the first case of ✹. So now we have the number of the next row of the category.
Step 3: Get the range in the middle
Now that we have the value we can get the range of the values to sum. This would be E<next row>:E<row before next category> or with a function:
indirect(
"E"&<next row>&":E"&<next category row>-1
)
so next row is row()+1 and the next category row is the result of the last step. Together:
=
indirect(
"E"&(row()+1)&":E"&vlookup(
"✹",
{
indirect("A"&(row()+1)&":A"),
arrayformula(row(indirect("A"&(row()+1)&":A")))
},
2,
FALSE
)-1
)
Step 4: sum
Now we can add sum to all of it. Nothing complicated here.
Step 5: Add conditional for empty categories
Some categories are empty so we need to check that the next row is an entry. This can be done with the simple if:
if(
indirect("A"&(row()+1))="✫",
<sum formula>,
0
)
So if you put everything together you get the result.
Final thoughts
Even though it seems massive the formula is not too complex. Try looking into it and let me know if there is something that's not clear enough.
Refrences
VLOOKUP (Docs Editor Help)
SUM (Docs Editor Help)
ROW (Docs Editor Help)
INDIRECT (Docs Editor Help)
IF (Docs Editor Help)
ARRAYFORMULA (Docs Editor Help)