I have a Google Sheet with named ranges that extend beyond columns A-Z. The name ranges have header rows. I would like to use the QUERY function to select columns by their header labels.
My formula is like this:
=QUERY(NamedRange,"SELECT AZ, AX, BM where BB='student' ORDER BY BM DESC",1)
Answers to other questions on StackOverflow, like that accepted here, haven't worked. Another answer found here on Google's support page doesn't work for columns beyond Z.
How can I use the QUERY function and select columns beyond column AA by their header labels?
DESIRED OUTPUT / SAMPLE DATA
A sample spreadsheet with desired output can be found here.










IMPORTRANGEfor security reasons though a user responding to the first linked question above states that it works as a go-around. For similar reasons, I'm also trying to avoid using Google AppsScript as I have multiple spreadsheets that need regular updating, some with new columns hence the need for selecting columns by header name.