Search code examples
google-sheetsdynamicreferencegoogle-sheets-formulacell

Using IMPORTRANGE to grab data from a sheet with a dynamic cell reference


In Google sheets, I'm trying to have a sheet that uses IMPORTRANGE to bring data from another sheet (a master). But I want the sheet name to be dynamic so I can reuse this sheet that I'm making depending on the list of names in the master.

The master sheet has a tab with all the names, which is where I'm trying to grab cell reference from. Using that reference, look in the tab with that name and grab the data from my given range.

What I'm trying is:

=importrange("1hwHYdFXwAFtBlvIVSYVsLi6x7XtGXlXcynIyaFgTbD0", ""&Class!A25&"!C1:BI")

It seems to be trying to grab from the class tab in the sheet I'm using the IMPORTRANGE formula in instead of the class tab of the sheet I want the data from.


Solution

  • You can do it by this way

    =importrange("__yourID__";importrange("__yourID__";"Class!A25") & "!C1:BI")