Dynamic workbook reference in Excel

Hi reader,

Today I will explain how to build a dynamic link to a workbook. Lets consider the workbook example bellow:

The aim is to return information from a cell in this previous workbook, in a new workbook (e.g. in the cell "B9"). Therefore, you need to identify the excel file path of that workbook, as in the image bellow.
To do so, you should use the following function:
  • =INDIRECT("'"&Filepath&"["&FileName&".xlsx]"&SheetName&"'!"&ExcelCell)
    • Filepath: Directory where the file you want to return information is located (e.g. cell "B4")
    • FileName: Name of the Excel file to return information (e.g. cell "B5"
    • SheetName: Name of the Excel sheet to return information (e.g. cell "B6")
    • ExcelCell: Excel cell to return information (e.g. cell "B7")
This formula works also for ranges. Just ensure that the origin file in opened when using this formula.

Hope it makes your spreadsheets easier.

Comments