google-sheets-formula

Reference a sheet with today's date as the name


I currently have a Google sheet with an apps script and timer that generates a new sheet once a day, with today's date as the name. The new sheet is automatically named "11/1/2024", tomorrow's sheet is automatically named "11/2/2024", etc. Using IMPORTRANGE, I want to import the data into a separate sheet file. But I only want it to import information from the most current sheet in the first file, the one with today's date.

The way I currently have the IMPORTRANGE formula set up, it is referencing a specific sheet name, i.e. =IMPORTRANGE("link","11/1/2024!A1:A50"). This works great for a day, but I want to implement a formula that will dynamically update each day to source the sheet with that day's date. I've tried implementing TODAY instead of the sheet name into the IMPORTRANGE formula, but it doesn't work.

Any assistance is appreciated, thanks in advance.

Edit: pgSystemTester did a wonderful job showing me a formula that worked for this situation, please see below. In Spreadsheet 1 I had to create a master sheet, which would reference the sheet with today's date and reflect that data. In Spreadsheet 2, a separate file, I could then use IMPORTRANGE to import the data from the master sheet in Spreadsheet 1. The master sheet in spreadsheet 1 was always updating to reflect the data of the sheet with today's date, and Spreadsheet 2 would import that updated data.

After more research I found another formula that works as well and eliminates a step. For anyone struggling with the same issue, this is the formula to import data from one google sheet to another citing the sheet with today's date as the title Using IMPORTRANGE:

=IMPORTRANGE("YOUR_SOURCE_SPREADSHEET_URL", TEXT(TODAY(), "MM/dd/yyyy") & "!A1:B10")


Solution

  • Depending on the date format you can use INDIRECT with TODAY and Text. This works for me...

    =indirect("'"&text(today(),"MM/DD/YYYY")&"'!A5")

    Link to a sample sheet

    enter image description here