Home > Mobile >  Google sheets query different sheets from named range in dropdown
Google sheets query different sheets from named range in dropdown

Time:11-12

I have 2 sheets (sheet1 and sheet2) and have created named ranges for each of them named sheet1 and sheet2.

To query sheet1 i use the following formula:

=QUERY(sheet1, "select A,B,C")

When i want to query sheet2 i have to edit my query formula. I dont want to have to do that, instead i want to select the sheet to query from a dropdown.

In cell B2 i have created a dropdown using data validation which populates my dropdown with Sheet1 and Sheet2.

Ive then modified my query to:

=QUERY(B2, "select A,B,C")

But i get the following error:

Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A

Is there a way to query each sheet by using a dropdown?

CodePudding user response:

try like this:

=QUERY(INDIRECT(B2), "select A,B,C")
  • Related