0

This is the query code I'm using to get form responses filtered to pull only a specific user ID from a google form in one Google Sheets workbook into another workbook:

=QUERY(IMPORTRANGE("KEYID#","Form Responses!Col1:A"), "SELECT * WHERE 'Col12'=222")

The sheet has 12 columns, A:L. Rows keep getting added as new submissions are made.

I want to pull only row entries with the user ID 222. User IDs are located in Row E/Column 5. 222 is a number, not a string.

The query above returns a Value error: "Error: Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: col12"

Without using IMPORTRANGE in the same workbook as the form database, I am able to query this using:

=QUERY('Form Responses'!A1:ABT,"where E=222")

Having two separate workbooks as intended, and I don't have the [select - where] statement,

=QUERY(IMPORTRANGE("KEYID#","Form Responses!COL1:A"))

spits out the entire form database.

Any ideas?

5
  • Questions and answers have revision history so in most cases there is no need to add update legends/notices to the Q/A body
    – Rubén
    Apr 24, 2018 at 15:08
  • Your first formula syntax is still wrong. Should be Col12 instead of COL12 and is still wrong Form Responses!COL1:A. The error is weird because in your formula COL12 is used not col12
    – Rubén
    Apr 24, 2018 at 15:09
  • Changing to col12 and "Form Responses!Col1:A" still generates the same error as I have above.
    – MalJD
    Apr 24, 2018 at 15:13
  • Col1:A isn't a valid reference in any casing combination. Don't use apostrophes to enclose column names.
    – Rubén
    Apr 24, 2018 at 15:16
  • Maybe you have to split your question/formula analysis in two, one regarding IMPORTRANGE and the other about QUERY.
    – Rubén
    Apr 24, 2018 at 15:22

1 Answer 1

1

The syntax of your first formula is wrong.

  1. Form Responses!COL1:A is not a valid reference. Hard to know what you are trying to do here. NOTES:

    1. Range references could have the form A1:B1, A1:B, A:B or 1:1 where A and B could be any column name while the first is the same column or it be always at the left of the second, also 1 could be any row number while the first is the same or it's on top the second.
    2. Using COL1:A as reference is converted to A1:COL where COL is the 26th column of the sheet.
  2. 'column(12)' is not the proper way to reference a column in the select argument of QUERY. Use Col12 instead without apostrophes/single quote marks.

3
  • Hi. I'm trying to pull data within one workbook that gets populated automatically from a Google Form, and bring it into another workbook. That data needs to be filtered by ID number so only the information related to that person is seen. Sorry, this system won't let me make carriage returns.
    – MalJD
    Apr 24, 2018 at 14:57
  • So, Form Responses!COL1:A is translated as [name of sheet]![range]. I've tried using COL12 instead of column(12), but I get an error that COL12 doesn't exist.
    – MalJD
    Apr 24, 2018 at 14:58
  • I've made updates above. Thank you for explaining further. This is my first time using StackExchange.
    – MalJD
    Apr 24, 2018 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.