Filter Across Multiple Ranges Possible? - google-sheets

Using Google Sheets. I'm trying to pull information to another sheet if certain criteria exists (equals 1, 2, etc.). The filter I'm trying to use is:
=filter({TestData!A5:I30,TestData!B5:B30=2},{TestData!K5:S30,TestData!L5:L30=2})
Is it possible to filter data across multiple locations with one formula this way?
Google Sheets gives me a formula parse error.

use the QUERY formula, like this:
=QUERY({TestData!A5:I30; TestData!K5:S30}, "SELECT * where Col2=2")

Related

combine data from selected sheets

I have a spreadsheet that has a lot of sheets of data grouped by category. I have a main sheet that I want a user to be able to choose which categories of data to use, and it will pull that data into one long list.
Here is an example spreadsheet of what I want to do: LINK TO SHEET
I could combine all the data into one spreadsheet, but if I were to do that with the dataset I am working with, I would have tens of thousands of rows. So, having the data stored on separate sheets is preferred. I am open to having separate spreadsheets altogether if that will make it easier. Currently, I have tried Using INDIRECT and QUERY, but can only get the first sheet of data to show.
I would prefer to stick to normal functions, but could jump into appscript if I need to create a custom formula
I have tried using INDIRECT and CONCAT, and can get the first set of data, but not subsequent data. Also tried wrapping it in a query like this:
=QUERY({ARRAYFORMULA(INDIRECT(CONCAT(A2:A,"!a2:z100"))},"select * where Col1 is not null",1))
Splitting it up into separate spreadsheets, I was able to use the function:
=QUERY({ARRAYFORMULA(IMPORTRANGE(B2:B,"A1:Z10"))},"select * where Col1 is not null",1)
But it also would only pull the first set of data, not the subsequent rows.
All of this was me first attempting to get the information, not getting the information filtered by the sheets that were checked as well. I am pretty familiar with appscript as well and open to appscript solutions, but would prefer to stay away from it if possible.
You do not need additional column. Use REDUCE() with few other formula-
=REDUCE(HSTACK("Dataset Name","Data 1","Data 2","Data 3","Data 4"),FILTER(A2:A,B2:B=TRUE),
LAMBDA(x,y,VSTACK(x,QUERY(INDIRECT(y&"!A2:E"),"where A is not null"))))

VLOOKUP in multiple ranges Google Sheets

I have a VLOOKUP formula to lookup from a different sheet as below:
=ARRAYFORMULA(IFERROR(VLOOKUP(B2:B6,Sheet3!A2:C,2,0)))
I would now like to expand the data on Sheet 3 but would like the next batch of data to be in range E2:G. Is it possible to have a VLOOKUP across 2 different ranges like this?
I've done lots of google searching without any joy tonight so thought I'd ask the question on here to make sure I'm not trying the impossible.
try:
=ARRAYFORMULA(IFNA(VLOOKUP(B2:B6, {Sheet3!A2:C; Sheet3!E2:G}, 2, 0)))

True/false check across multiple google sheets with 2 criteria

So I've been trying to find a way to check multiple sheets on a column on the master sheet.
Previously the different sheets used a mixture of importrange and index/match to match town(each sheet is a different one)/number and pull a separate, matching columns number into said sheet.
=IF(B9>0,IFNA(INDEX(IMPORTRANGE("MAINSHEETLINK","Civils!$J$5:$J$500"), MATCH (B9,(IMPORTRANGE("MAINSHEETLINK","Civils!$I$5:$I$500"))*(IMPORTRANGE("MAINSHEETLINK","Civils!$D$5:$D$500")=$P$7), 0)),0),"0")
the $P$7 is the town name on the row it searches for.
The ifna just keeps it clean.
I can't figure out how I can use vlookup or query to search multiple sheets in this way. There's a separate Yes/No check on the secondary sheets that checks whether or not something was imported. I'd like a separate column on the main sheet to check across multiple sheets to true/false if the above check is Yes/No.
There's a possibility I have several nested if functions working through each sheet using the above index/match, but that seems prone to breaking, not to mention having to redo it once new sheets crop up.

Google Spreadsheet - VLookup Values From Another Workbook

I have a huge year of data and I cannot add it in 1 spreadsheet because of the limitation on the number of cells per workbook/spreadsheet so I separated the huge data into multiple files by month (January, February, March etc).
In my master file/spreadsheet I needed to use a formula to lookup some values from the master spreadsheet and the problem is that the tables to look into are now in multiple monthly spreadsheets. What is the best formula to look up values in multiple spreadsheets?
After googling for a while I don't have much options, I don't even know what the formula is for using Vlookup to find values in a separate spreadsheet instead of another tab. I tried importrange and it seem to still use the limit even though it's in a different spreadsheet I get error when trying to use it because the data is too large.
So you can use IMPORTRANGE to get the columns needed for the vlookup.
=VLOOKUP(D42,IMPORTRANGE("https://docs.google.com/spreadsheets/d/[sheet_id]","Sheet1!D:ZZ"),1,0)
It's not clear if you added the permission needed to access the other workbook when you use IMPORTRANGE
like this
You can also use IMPORTRANGE in the data parameter QUERY(data, query, [headers])
QUERY is awesome when you know your way around SQL. Google Visualization API Query Language

Union clause in Google Visualization Query Language

I need to create a single datatable pulling datas from different sheets of a Google Spreadsheet, is there a way to emulate in Google Visualization API Language the union clause provided by SQL?
Google Query Language documentation shows there's no union avaliable and actually this sounds reasonable because changing sheet the part affected is the address (different gid) not the query statement.
One way to emulate the SQL UNION clause is to append the different source ranges by using the array handling features of Google Sheets.
Example:
Assume that there are two ranges to put together as a single array, Sheet1!A1:B10 and Sheet2!A5:B25. Then write the following formula in the cell A1 of new sheet
={Sheet1!A1:B10;Sheet2!A5:B25}
For further details checkout Using arrays in Google Sheets

Resources