Search code examples
filtergoogle-sheetsconcatenationgoogle-sheets-formulaimportrange

How to change import range within expression from cell


I want to have my expression change based on the value in A1. In A1 the user will put the Month Year (July 2019) I want to know if it is possible to change this "July 2019!A1:U23" value based on that data. So next month in a1 if the user inputs August 2019 it will update the expression with that date. A1 corresponds to the sheet name

IE: A1 = August 2019 "August 2019!A1:U23"

=filter(importrange("SheetID","July 2019!A1:U23"),importrange("SheetID","July 2019!F1:F23")=".DM1")

Solution

  • yes, it is possible. all you need to do is:

    =FILTER(IMPORTRANGE("SheetID", A1&"!A1:U23"), 
            IMPORTRANGE("SheetID", A1&"!F1:F23")=".DM1")