Pantalaimon

Kludge to use IMPORTRANGE with INDIRECT in Google Sheets

Apr 22nd, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. The correct kludgey way to use IMPORTRANGE combined with an INDIRECT in Google Sheets, to dynamically grab data (which can be a cell, a cell range, or basically an entire sheet if you use a huge range). Stumbled upon completely accidentally after hours of searching; thanks completely obtuse Google documentation!
  2.  
  3. --
  4.  
  5. =IMPORTRANGE("[key]", "[]"&INDIRECT("[function]") )
  6.  
  7. * don't include the []
  8.  
  9. [key] = key to your other spreadsheet, which is shown in the URL.
  10. [] = just some blank space in quotes, or can be any fixed part of the function which doesn't change (eg a preceeding column letter). This appears necessary to satisfy the app that you are indeed providing it some string. You can't just use INDIRECT on its own as it errors out.
  11.  
  12. [function] = whatever you want to do to bring in the cell reference for the second sheet.
  13.  
  14. eg. INDIRECT( "A"&SUM(B1:B10) )
  15.  
  16. Whatever you put inside the INDIRECT("") must obviously produce a cell reference to a cell on your current sheet, and in that cell you can do whatever you like to produce ANOTHER cell reference (this time, the one referring to your separate data sheet).
Add Comment
Please, Sign In to add comment