Reference ever changing file name, last occurance

288enzo

Well-known Member
Joined
Feb 8, 2009
Messages
721
Office Version
  1. 2016
Platform
  1. Windows
Hi again,

I have a formula in one excel file that references a separate excel file. This issue is the file that is referenced changes each time it's downloaded to something like "file_name_MMDDYYYY". I found something similar -https://www.mrexcel.com/board/threads/referencing-file-to-open-with-partial-name-changing.1177202/#post-5725984, which would work; however how do I get around having multiple versions of the file that is referenced? What I really need to be able to do is reference the last saved occurrence of "file_name_".

To keep it simple, as an example my formula would be

Excel Formula:
=IF([Has_Has_Not_Taken_Report_09172021.xlsx]Sheet1!$E$191="incomplete",TRUE,FALSE)

Can what I'm asking even be done? I'm trying to avoid making sure those who use this are using the last instance of the file.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You can use Power Query (Excel Get and Transform) to Get all files in a folder. When it lists the files, Transform the data. You could then use the "Date modified" or "Date created" property (which are columns in Power Query) and filter for IsLatest. Then remove all columns but the filename, so that when you Close and Load, you are populating a single cell with the filename you require. Then use that in your formula. You will need to Refresh the query to get an up-to-date result, but you can set PQ to refresh when you open a file, or every n minutes.
 
Upvote 0

Forum statistics

Threads
1,214,870
Messages
6,122,021
Members
449,060
Latest member
LinusJE

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top