I am struggling with my query. It is only showing my header rows. I would like the choice of “staff” or “student” match column C on Responses tab and then the “1.) 11/3/2022 for Boy’s Basketball” match Column E on Response tab. When those two conditions are selected I want to see just the data matching staff and that event. I’m at a loss of how to get this to work.
https://docs.google.com/spreadsheets/d/1icO6CI_xM75jH8PSFSMFrWYZqnBLEIEBNZZI-oDAm_s/edit
Your formula attempt is:
=query('Form Responses 3'!1:103,"SELECT D,F WHERE C = '"&A1&"' and F = '"&B1&"'")
That fails because your search keys include an apostrophe '.
The easiest solution is probably to express the same through filter(), like this:
=filter(
{ 'Form Responses 3'!D2:D, 'Form Responses 3'!F2:F },
'Form Responses 3'!C2:C = A1,
'Form Responses 3'!F2:F = B1
)
See your sample spreadsheet.
Related
I'm trying to utilize Google Sheet to pull out rows which has errors.
Below is a screenshot on how the raw data looks like (Raw Data 1):
Column A is the key, which is used in Column F to do a VLOOKUP in another tab. If not found, replace with a "-" string value, as below:
=IFERROR(VLOOKUP(A2,'Raw Data 2'!$A:$E,5,FALSE), "-")
Column G checks whether Column E = Column F.
Column H is a formula which is (F-E)/E. In this case, a "#VALUE!" error pops out due to column F, which is okay for now.
Below is my processed tab with the formula:
=QUERY('Raw Data 1'!A:J, "SELECT A,B,C,D,E,F,G,H,J WHERE F='-'")
I have also tried:
=QUERY('Raw Data 1'!A:J, "SELECT A,B,C,D,E,F,G,H,J WHERE H='#VALUE!'")
Both give me empty results. Is there a way to make the query work such that it picks up rows where the VLOOKUP in Column F fails, or when Column H returns an error?
Edit 1: I am not able to use "Filter" as my Query needs to exclude Column I.
Thanks!
Edit 2: Created a sample sheet for reference thanks to the suggestion of #player0: https://docs.google.com/spreadsheets/d/1Htj6O5VbGyRCB_X7Q0epIg8OkhrHEFYnMAH1HJckVDo/edit#gid=1568356550
Try this:
=FILTER('Raw Data 1'!A:J, 'Raw Data 1'!F:F="-")
Or:
=FILTER('Raw Data 1'!A:J, ISERROR('Raw Data 1'!H:H))
update:
=ARRAYFORMULA(QUERY(TO_TEXT('Raw Data 1'!A:J), "WHERE Col6='-'", ))
I'm trying to set up a summary sheet that pulls relevant information based on input from three Data Validation drop-downs.
Link to the sheet: https://docs.google.com/spreadsheets/d/1LlOdONYI6hd2U5uVmD4C5i3WpuieOdohxIAnwfudUC8/edit?usp=sharing
I have a QUERY in 'Calculations'!E2, with Data Validation in 'Calculations'!F2 based on the results in 'Calculations'!E2, then two other QUERY in 'Calculations'!G2 and 'Calculations'!I2 with accompanying Data Validation in 'Calculations'!H2 and 'Calculations'!J2 respectively.
My first problem is when I get to the Data Validation in 'Calculations'!J2: Regardless of whether the selection looks identical to one of the times displayed in 'Calculations'!C:C, I always get an "Input must fall within the specified range" error.
My second problem: I can't get a formula to work that pulls the information I'm looking for from the "Form Responses" sheet. I've tried an INDEX(MATCH()) in 'Summary'!A8, and a VLOOKUP in 'Summary'!A10, but both say they can't find the date from 'Calculations'!J2.
I've tried adding/ removing significant digits with formatting and ROUND functions, but it won't match even though the data should be identical (the number in 'Calculations'!J2 is literally pulled directly from the dates in 'Form Responses'!A2:A, isn't it? Is that the problem?).
Thanks in advance for the help!
E2:
=UNIQUE(QUERY(A2:A, "where A is not null", 0))
G2:
=UNIQUE(QUERY(A2:C, "select B where A = '"&F2&"'", 0))
I2:
=ARRAYFORMULA(N(QUERY(A2:C, "select C where A = '"&F2&"' and B = '"&H2&"'", 0)))
K2:
=ARRAYFORMULA(IFNA(VLOOKUP(J2, {C2:C, A2:C}, {2, 3, 4}, 0)))
I originally have this formula:
=QUERY('Sheet1'!$C$6:$I, "Select F where D contains '"&$B86&"'")
This is applied to every cell from $B86 down to $B145. Users of the sheet accidentally deletes formula and adding protection isn't an option. So I'm thinking of adding the formula to the header only using arrayformula. However, arrayformula can't be used for query.
QUESTION 1:
Is there any other way around to get the same result when only the header has the formula?
={"Messages Sent";ARRAYFORMULA(QUERY('Sheet1'!$C$6:$I, "Select F where D contains '"&B86:B145&"'"))}
This is kinda what I want to achieve. However, this doesn't fill the data from B87 to B145. I only get the header and result for 1 row below the header.
Explanation
This shows the header ={"Messages Sent";
This is supposed to be the arrayformula ARRAYFORMULA(QUERY('Sheet1'!$C$6:$I, "Select F where D contains '"&B86:B145&"'"))}
This is the data from another sheet 'Sheet1'!$C$6:$I
This is the same data from the current sheet to find F in sheet 1 '"&B86:B145&"'
QUESTION 2: HOW CAN I GET THE ANSWER FROM THE QUERY AUTOMATICALLY SET INTO A NUMBER FORMAT SO I CAN DIRECTLY ADD THEM INSTEAD OF FORMATTING THEM MANUALLY AS NUMBER?
try maybe:
={"Messages Sent"; ARRAYFORMULA(IFNA(VLOOKUP(B86:B145,
{REGEXEXTRACT(""&Sheet1!D6:D, TEXTJOIN("|", 1, B86:B145)), Sheet1!F6:F*1}, 2, 0)))}
We have Employee training data in a Google 'Form Response' spreadsheet which ranges from A1 to JQ1000. This spreadsheet is automatically populated when a Goggle Form is completed but it is difficult to look at so I want to tidy it up.
The Form Response spreadsheet is populated with the Training Event, the date of the event and the employees who attended that event. To tidy it up I thought it best to use Transpose(Query but an employee's name might appear several times in different columns and different rows. I don't want to have to write 'Select * WHERE C = 'David Bowie' OR D = 'David Bowie' OR E = 'David Bowie'" and so on out to column JQ. Can someone help me with a simpler formula?
you can do it for example like this:
=ARRAY_CONSTRAIN(QUERY({A1:JQ, TRANSPOSE(QUERY(TRANSPOSE(A1:JQ),,999^99))},
"where Col"&COLUMN(JQ1)+1&" contains 'Sara'", 0), 999^99, COLUMNS(A1:JQ))
I am trying to filter a Google sheet with columns A to O using a query on a second sheet. I can put this formula in a new sheet and it pulls all the data just like its supposed to.
=query('Inventory'!$A$1:$O, "select * ", 1 )
What I am trying to do is filter the spreadsheet with a where clause that is to use a cell dropdown list (generated by unique values in the original sheet). I have used this formula:
=query('Inventory'!$A$1:$O, "select * where B = "&C1&"", 1 )
where C1 has the drop down box. This always gives me the error:
"Error
Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: value" (the value depends on what is selected in the drop down).
It also doesn't work if I wrap the B = "&C1&" in parenthesis () which i have seen other posts use.
When I looked at Google's site for their example (https://support.google.com/docs/answer/3093343?hl=en), this should be a no-brainier unless something changed and their site isn't up to date.
I apologize for something this simple.
Try
=query('Inventory'!$A$1:$O, "select * where B = '"&C1&"'", 1 )