1

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?

player0
  • 124,011
  • 12
  • 67
  • 124
chappers
  • 466
  • 1
  • 6
  • 17

1 Answers1

2

try like this:

=QUERY(INDIRECT(B2), "select A,B,C")
player0
  • 124,011
  • 12
  • 67
  • 124