0

=QUERY(ActiveMonth!A7:L,"select A,D where K matches 'Admission|Pending'",0)

I am using sheets name/tabs (January, February.. December). ActiveMonth is a namedRange of a cell containing the Month Name (A1). I want to query the tab with the activeMonth name. If the ActiveMonth (A1) is January then the formula will run as =QUERY(January!A7:L,"select A,D where K matches 'Admission|Pending'",0).

1 Answer 1

1

=QUERY(indirect(ActiveMonth&"!A7:L"),"select A,D where K matches 'Admission|Pending'",0)

https://stackoverflow.com/questions/14850828/dynamic-sheet-name-in-query-in-google-spreashsheet

1
  • 1
    Since your named range consists of just 1 cell "...ActiveMonth is a namedRange of a cell containing the Month Name (A1)", you can skip the named range all together and just replace it by the cell itself. In this case it would be indirect(A1&"!A7:L") Commented Mar 8, 2021 at 11:15

Your Answer

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

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