Google Sheets QUERY IMPORTRANGE formula - google-sheets

enter link description hereI'm trying to get a return of all Active jobs but I keep getting the error message #value!; "Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A". Here is the formula I used.
=QUERY({IMPORTRANGE("SheetKey","employeeName1!A18:V1000"); IMPORTRANGE("SheetKey","employeeName2!A19:V1000");IMPORTRANGE("SheetKey","employeeName3!A19:V1000");IMPORTRANGE("SheetKey","employeeName4!A19:V1000")},"SELECT A, B, C, D, E WHERE E = 'Active'")

I tried replicating your issue by making a copy of your provided sample sheet but apparently, the formula works after making a copy of the sheet. Please see attached screenshot.
I suggest trying to copy it first making a new sheet with the same content and see if it will also solve your problem.

use:
=QUERY({
IMPORTRANGE("SheetKey", "employeeName1!A18:V1000");
IMPORTRANGE("SheetKey", "employeeName2!A19:V1000");
IMPORTRANGE("SheetKey", "employeeName3!A19:V1000");
IMPORTRANGE("SheetKey", "employeeName4!A19:V1000")},
"select Col1,Col2,Col3,Col4,Col5
where Col5 = 'Active'")

I took out the IMPORTRANGE and just used a query formula for the other sheets and it worked perfect. Thanks for the input everybody.

Related

Google Sheets: Textjoin from another sheet not working

Working with the Base and Data tabs from this sheet: https://docs.google.com/spreadsheets/d/1OsSWQ_48VrcTU3pXGeJ_1syluKPVeVRune39UA9I3x4/edit?usp=sharing
Expected result is textjoin of all colors matching SKU separated by comma in column C on Base tab.
Expected result shows in Column D, done manually.
All formulas i've tried either put everything in one cell (C2), gives an N/A error(C4), just pulls the first result (C5) or it is just completely blank.
Please help? If you cannot, then thank you for reading anyway.
I did it on a new Sheet on the Spreadsheet that i took the liberty to create (hope it's ok)
For getting the colors I used QUERY: so it came out as QUERY(Data!B:G,"select G where B = '"&A2&"'". After that I just fed that to your JOINTEXT formula

Is there a way to make a query with an importrange to mimic a sumif formula from another Google sheet?

I am encountering a capacity issue with one of my spreadsheets but certain information in the sheet still needs to be available to cross-reference. The original spreadsheet contains this formula:
=sumif(A:A,A2,N:N)=O2
I tried to do a direct transfer to the new spreadsheet by adding importranges like this:
=SUMIF(IMPORTRANGE("URL","Sheet1!A2:A"),IMPORTRANGE("URL","Sheet1!A2"),IMPORTRANGE("URL","Sheet1!N2:N")=IMPORTRANGE("URL","Sheet1!O2")
The equation keeps putting out an error saying "argument must be a range". Then I tried to write it out as a query like this:
=QUERY(AND(IMPORTRANGE("URL","Sheet1!A:A"),IMPORTRANGE("URL","Sheet1!N:N"),"SELECT SUM(CASE WHEN Col1=A2 THEN Col14)=O2"))
But the equation is showing FALSE as the result when it should say TRUE. I have attached an example spreadsheet so that these equations make more sense.
I also need the equation to take into account any new information that is placed on the new spreadsheet while also comparing it with the old info. I tried doing this to start with but then slowly realized the initial equation itself doesn't work.
=SUMIF(IMPORTRANGE("URL","Sheet1!A2:A"),IMPORTRANGE("URL","Sheet1!A2"),IMPORTRANGE("URL","Sheet1!N2:N"))=IMPORTRANGE("URL","Sheet1!O2")+SUMIF(A:A,A2,N:N)=O2
Any help is appreciated.
https://docs.google.com/spreadsheets/d/1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo/edit#gid=0
use this formula instead of SUMIF:
=ARRAYFORMULA(IF(LEN(
IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!C2:C")),
IF(IFERROR(VLOOKUP(
IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!C2:C"),
QUERY(IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!A2:N"),
"select Col3,sum(Col14) where Col1 is not null group by Col3 label sum(Col14)''"),2,0))=
IMPORTRANGE("1q1cWh58p23dcQulQ4rz6v4iiDywEFHvcrvASao61xxo","Sheet1!O2:O"), TRUE, FALSE),))

IMPORTRANGE: value missing?

I have been working on this issue for a few weeks now and can't seem to find a solution. I used this answer (IMPORTRANGE with CONDITIONS) to get as far as I could, but I keep getting a value error.
This is the sheet I'm working with.
My goal is to use the first tab in the sheet (All Games) to enter all the games that I come across to create a compendium. But, then I want it to automatically populate the other tabs based on certain criteria (what type of game, skills learned, etc.)
On the Warm-Ups tab you'll see the formulas I have tried. A1 is the most recent.
Here is the formula I tried:
=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1F64PMg_iFu-DaJAUaE4BkpqF4zoteknp56VfwAUe8ag/edit#gid=1359689553", "All Games!A1:A1300"),"SELECT Col1 WHERE (Col2 = 'w') ")
I am getting a value error:
Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: Col2
you are trying to reference Col2 but you selected range A1:A1300 which is just 1 column. therefore try:
=QUERY(IMPORTRANGE("1F64PMg_iFu-DaJAUaE4BkpqF4zoteknp56VfwAUe8ag", "All Games!A1:B1300"),
"SELECT Col1 WHERE (Col2 = 'w') ")
from the brief look on your sheet, you may want use matches or contains instead of = in your QUERY
You are only importing (part of) ColumnA - so no wonder Google can't find a second column :)

IS NOT NULL - A simple google sheets query issue

I want my google sheets query to just filter out the rows with a blank value and possibly the ones containing specific words as well
Here's an example spreadsheet, I've tried using "where B is not null" in the query but it's not working! I'm tearing my hair out over this as i'm sure it's a simple solution.
https://docs.google.com/spreadsheets/d/1xZH1MKeqLa8r1gRGL9wYHEWe02wQoNNpqqL_ca1fGf0/edit?usp=sharing
Thanks in advance for your help!
you may need to test for empty string instead of null, you can add AND to remove other values:
=QUERY(A2:B6,"select A, B where B<>'Pizza' and B<>''")
This just worked for me
=QUERY(A2:B6,"select A, B where B!='' ",0)

What's wrong with this Google Spreadsheets QUERY?

I've been struggling with this Spreadsheets query problem for hours and even after rigorous googling, couldn't figure out what's wrong or how to do this properly. Here's an example of the problem:
=QUERY('Sheet2'!2:3, "select B where A="A2"")
Example Spreadsheet: https://docs.google.com/spreadsheets/d/172kaXIs0-OhWxhvI65OvnfM1jiLt6OdQVrGYDjxf6V8/edit?usp=sharing
What I'm trying to do is pull data from the Sheet2 so that I can also include the A2 cell from Sheet1 in the equation for better automation. I know there's a way to do it but I just can't seem to be able to make it work.
The syntax is two pairs of quotes (each a single and a double) around concatenation with &. Please try:
=QUERY(Sheet2!2:3, "select B where A='"&A2&"' ")
Your version should work if the actual content of A2 were A2.

Resources