Return cell from another sheet if it contains string in column [closed] - google-sheets

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"
)

Related

VLOOKUP first 5 characters [closed]

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; ))))

How to reference to a previous row within a column with Arrayformula in Google Sheets [closed]

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.

Sum in a column until it meets another category [closed]

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)

Alphabetizing data from the filter function [closed]

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 2 years ago.
Improve this question
I have data from multiple tabs in Google Sheets that I am combining into one master tab. I would then like the data on the master tab to be alphabetized based on the last name in one column automatically if more information is added. Here is the formula I used to combine the multiple tabs onto the master tab:
={filter(tab1!A5:Z, tab1!B5:B<>"");FILTER(tab2!A5:Z, tab2!B5:B<>""); FILTER(tab3!A5:Z, tab3!B5:B<>""); FILTER(tab4!A5:Z, tab4!B5:B<>"");FILTER(tab5!A5:Z, tab5!B5:B<>""); FILTER(tab6!A5:Z, tab6!B5:B<>"")}
I have not been able to find anything that would work when I google "how to sort data in abc order from a filter function google sheets".
You can use SORT() and there's even an example in its documentation that applies to your situation:
SORT({1, 2; 3, 4; 5, 6}, 2, FALSE)
So if the last name is in column B, which is the second column you could write (formatted for clarity)
=SORT(
{
FILTER(tab1!A5:Z, tab1!B5:B<>"");
FILTER(tab2!A5:Z, tab2!B5:B<>"");
FILTER(tab3!A5:Z, tab3!B5:B<>"");
FILTER(tab4!A5:Z, tab4!B5:B<>"");
FILTER(tab5!A5:Z, tab5!B5:B<>"");
FILTER(tab6!A5:Z, tab6!B5:B<>"")
},
2,
TRUE
)

Searching one Google Sheet to add a row of data to another [closed]

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 4 years ago.
Improve this question
I searched and was able to find some similar questions like this, but I wasn't able to find exactly what I'm looking for and I wasn't able to use the formulas in the other questions to make this work. So sorry in advance if this has been asked before!!
Basically, I have multiple Google Sheet files (about 12 in total). Here I'll call them "Master", "Client1", Client2" and so on. For simplicity, I've just named the sheets within the files to be "Sheet1" :)
The column headers in each spreadsheet are "Brand" "Client Name", "Client Location", "Client Email", , etc... In the "Client1", Client2", etc... workbooks the first column will always be the same as the filename.
The "Master" workbook contains information on all of the clients and what "Brand" they work for (or in some cases, which Brands they work for, which makes this tricky).
Here is a picture of the "Master" workbook as an example
As pictured, some have multiple Brands, all are different clients, locations, emails.
This is what the Client1 workbook looks like currently
but I need a formula to insert into the Client1 workbook and search the first column of Master workbook and then display data if column A in Master contains "Client1"
So basically here is what Client1 would need to look like when all is said and done
I've tried things like =IFERROR, =vlookup, =RegExMatch and can't get any of them to work. I know it has to be something simple that I'm doing wrong, but I'm at my wit's end.
Any and all help would be AMAZING!!!!!
if this is your master:
then:
={TRANSPOSE(SPLIT(REPT("client1 ", COUNTA(
QUERY(QUERY(master!A2:D, "select *", 0),
"select Col2,Col3,Col4
where Col1 contains 'client1'", 0))/3)," ")),
QUERY(QUERY(master!A2:D, "select *", 0),
"select Col2,Col3,Col4
where Col1 contains 'client1'", 0)}

Resources