I have a problem with the following, I have a sign in/out sheet created that will be used in a main office, I would like staff to be able to search the sheet for names without having access to the sheet, so in a new sheet I have created the following formula
=query(importrange("https://docs.google.com/spreadsheets/d/1UKOGokeckL8QIBreKe253l7CfZ3Ra7QrLyWBGav_Cdw/edit#gid=0","Sign IN/OUT!A3:E"), "SELECT * WHERE 1=1 "&"AND LOWER('Sign IN/OUT!A:A') LIKE LOWER(""%" &JOIN("%"") AND LOWER('Sign IN/OUT!A:A') LIKE LOWER(""%", SPLIT(B1," "))&"%"")",1)
This is only showing the first row from the imported data.
Any help on getting the formula corrected would be of great help. I am able to use the following code within the same workbook to accomplish the search
=query('Sign IN/OUT'!A3:E, "SELECT * WHERE 1=1 "&"AND LOWER(A) LIKE LOWER(""%" &JOIN("%"") AND LOWER(A) LIKE LOWER(""%", SPLIT(B1," "))&"%"")",1)
so I feel like this should work, what am I missing?
Thanks,
try:
=QUERY({IMPORTRANGE("1UKOGokeckL8QIBreKe253l7CfZ3Ra7QrLyWBGav_Cdw", "Sign IN/OUT!A3:E")},
"where 1=1
and lower(Col1) like LOWER(""%" &JOIN("%"")
and lower(Col1) like LOWER(""%", SPLIT(B1, " "))&"%"")", 1)
Related
I am trying to have a master file that contains data from 3 separate sheets. Each sheets has the same first 5 columns in order but 3 other columns are in different order in the 3 sheets. How can I combine the data when columns are located differently into one master file?
you can rearrange columns in {} array:
=QUERY({
{QA_Assignments_2021!A2:H};
{QA_Group_2021!A2:F, QA_Group_2021!H2:H, QA_Group_2021!G2:G};
{QA_LOMFCU_2021!A2:H}},
"where Col1 is not null")
or you can do it with multiple queries like:
=QUERY(
{QUERY(QA_Assignments_2021!A2:H, "select A,B,C,D,E,G,H,F");
QUERY(QA_Group_2021!A2:H, "select *");
QUERY(QA_LOMFCU_2021!A2:H, "select A,B,C,H,G,E,F,D")},
"where Col1 is not null")
player0 already provided a great idea of how you will solve your issue. If you are doing it right, it should look like the formula below:
=Query({
Query(QA_Assignments_2021!A2:AB, "select A,B,C,D,E,F,I,N,H");
Query(QA_Group_2021!A2:AB, "select A,B,C,D,E,F,T,L,R");
Query(QA_LOMFCU_2021!A2:AB, "select A,B,C,D,E,F,Y,H,S")
}, "where Col1 is not null")
Output:
Note:
The three A2:AB can be simplified into A2:N, A2:T and A2:Y respectively since you don't need the columns beyond that. But either of the two should work. Adjust the ranges and columns to be queried accordingly if needed.
i am looking for some help to pull the data in Sheets based on another sheet called "ServicesOffered"
here is the sheet link
The idea is simple: If Cell contains Yes then it should add data to WebDev sheet or SEO sheet.
Tried many different formulas but failed to understand how to do this.
Need to have a column list or * after the Select; also shouldn't have curly brackets round the range or else it will treat it as an array and expect Col1, Col2, Col3 etc. in the Select instead of A, B, C etc.
=QUERY(
ServicesOffered!A2:C,
"SELECT * WHERE C = 'Yes' ",1)
I am importing data from two different Google sheets and merging them in another sheet. The formula which I used is as below .
=QUERY({
IFERROR(QUERY(
{ IMPORTRANGE("" , "Sheet1!$A$1:$b") },
"SELECT Col1,Col2 WHERE Col2='Total'",
0
)) ;
IFERROR(QUERY(
{ IMPORTRANGE("" , "Sheet1!$a$1:$b") },
"SELECT Col1,Col2 WHERE Col2='Yes'",
0
))
})
In above formula, importrange is giving the result when both sheets have data to import, but if any one sheet has no data to import the data from another sheet is not getting imported. I had figured a solution at below link where we can handle this issue by using dummy column reference, this approach is fine when we have few sheets to import with few columns but when we are importing from many sheets and many column to import the dummy column reference gets too long. Is there any other way to solve this issue.
The easiest way to do this is to use an IFERROR(SEQUENCE(1,n)/0) as your output for when a query of an importrange fails instead of needing to list a bunch of blanks.
The solution for your simple example looks like this where n = 2:
=ARRAYFORMULA(QUERY({IFERROR(QUERY({IMPORTRANGE("1hea986JF3plR_tn7plNRgjWhiGqxOlR8s8yE-Ri6FfU" , "Sheet1!$A$1:$b")}, "SELECT Col1,Col2 WHERE Col2='Total'",0),IFERROR(SEQUENCE(1,2)/0));IFERROR(QUERY({IMPORTRANGE("1IbPpoLLfa-ukoz2WInlgNGSNMNBxBwSx4in52fZCEyE" , "Sheet1!$a$1:$b")},"SELECT Col1,Col2 WHERE Col2='Yes'",0),IFERROR(SEQUENCE(1,2)/0))},"where Col1 is not null"))
Link to Google Doc: https://docs.google.com/spreadsheets/d/1kC9086eSa-YO1EWEhDvdKGopgyeyDwbw8xCuejnyU7w/edit?usp=sharing
I am currently trying to create a tool that allows me to search for keywords out of an entire list I generated in a different tab. I want it to pay attention to different types of filters. It has the following table to enter search criteria:
Keyword Explorer Table
The query box in the table is the first filter I want to run. In the example, all keywords contain the word "onesie." For example, if I type "baby" in the query, then it would look at the filter type which is a dropdown menu. In the image below, I am selecting "contains" as the filter type.
Query and Filter Type
In the table, I also want the functionality to add several "AND" and "OR" filters.
Here is a layout of the entire table:
Keyword Explorer Tab in Google Sheets
Columns B through D are all just VLOOKUPS of Column A. The formula for the entire tab is in A2. The formula is currently
=QUERY('Onesie US Info'!A2:A,
"select A
where lower(A) "&G4&" '"&G2&"'
and (lower(A) "&G4&" '"&I2&"') or (lower(A) "&G4&" '"&J2&"')
", 0)
But it isn't working. I would like to know if it's possible to get the filtering table to work the way I'd like.
perhaps like this:
=IFERROR(QUERY(QUERY('Onesie US Info'!A2:A,
"select A
where lower(A) "&B2&" '"&I2&"'
and lower(A) "&B2&" '"&I3&"'
and lower(A) "&B2&" '"&I4&"'", 0),
"select Col1
where lower(Col1) "&B2&" '"&J2&"'
or lower(Col1) "&B2&" '"&J3&"'
or lower(Col1) "&B2&" '"&J4&"'", 0), )
I have multiple google sheets (45 of them, all dynamic, its content will keep on changing) and I want to combine data of all of them into a single file. I was hoping to use some importrange or QUERY function so that moment one / any file is updated, the changes reflect automatically on the combined sheet.
Example book 1 :
https://docs.google.com/spreadsheets/d/1sOkV9BT8ptndE0xcN2MUi4tTZ5p-aZxuLY_u29Y6nBI/edit?usp=sharing
Example book 2 :
https://docs.google.com/spreadsheets/d/1jZml9oVI2Flma407AB4ndl_ZIsQ_5I8zhkzvbL_EO_g/edit?usp=sharing
Example combined book :
https://docs.google.com/spreadsheets/d/1LkiIY1aUmwaouR7f4KhaGs6MV365KY7DYUPMiTzxjvc/edit?usp=sharing
first you need to connect them by pasting each IMPORTRANGE formula in some cell to get #REF! error
then hover over that #REF! error with your cursor and a secret magic button will popup
click on it to allow access
then you can stack up all import ranges and wrap them in a query:
=QUERY(
{IMPORTRANGE("ID1-or-URL1", "Sheet1!A1:A");
IMPORTRANGE("ID2-or-URL2", "Sheet1!A1:A");
IMPORTRANGE("ID3-or-URL3", "Sheet1!A1:A");
IMPORTRANGE("ID4-or-URL4", "Sheet1!A1:A")},
"where Col1 is not null"), 0)
update:
={ IMPORTRANGE("1sOkV9BT8ptndE0xcN2MUi4tTZ5p-aZxuLY_u29Y6nBI", "Sheet1!A1:N2");
QUERY({IMPORTRANGE("1sOkV9BT8ptndE0xcN2MUi4tTZ5p-aZxuLY_u29Y6nBI", "Sheet1!A3:N" );
IMPORTRANGE("19SFnJab9xVW2SenK-8IuG2cQRT2exJeyqARjTdDE_R8", "Sheet1!A3:N" )},
"where Col1 is not null", 0)}