Formula recalculates when it should not

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
233
Office Version
  1. 2021
Platform
  1. Windows
Hi,
I have the following formula in a workbook which brings in the file name the workbook (19 REGISTER market data) except for the file extension.
=LEFT('[19 REGISTER market data.xlsx]COMPLETED ->'!$B$12,LEN('[19 REGISTER market data.xlsx]COMPLETED ->'!$B$12)-5)
If the workbook with the file name being referenced (19 REGISTER market data) is open and I make an entry in another workbook other then the referenced workbook (19 REGISTER market data) and press enter; tab or one of the arrows the destination workbook shows the file name for the workbook where I just made the entry, even though the formula has not changed.
Recalculating the referenced workbook (19 REGISTER market data), returns the correct result in the destination workbook.
If the referenced workbook is closed, the issue does not occur.
Any thoughts or solutions to correct this would be greatly appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
If I am reading the formula correctly, it only fires when the document is opened. It doesnt look like it checks if anything has changed, just that the book is there. If the book is opened, and a cell/sheet/book change trigger is fired, all formulas go through a recalculation. In other words, as long as the referenced book is opened, when a new cell is selected, the formula will recalculate. If the book is not opened, it has nothing to reference, so it will not calculate.

I will be the first to admit that I am not the best at formulas, but I am sure there is a way around this that would require some settings being changed. That being said, I would tackle the problem by writing a VBA Macro, and linking it to a button that can be pressed. It would not be an 'Automatic' result, like the one you have here (instead requiring a button press when ready), but it would only fire when you are ready for it to.
 
Upvote 0
Hi, what formula do you have in this cell REGISTER market data.xlsx]COMPLETED ->'!$B$12 ?
 
Upvote 0
Hi, what formula do you have in this cell REGISTER market data.xlsx]COMPLETED ->'!$B$12 ?
Here it is:
=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
 
Upvote 0
If I am reading the formula correctly, it only fires when the document is opened. It doesnt look like it checks if anything has changed, just that the book is there. If the book is opened, and a cell/sheet/book change trigger is fired, all formulas go through a recalculation. In other words, as long as the referenced book is opened, when a new cell is selected, the formula will recalculate. If the book is not opened, it has nothing to reference, so it will not calculate.

I will be the first to admit that I am not the best at formulas, but I am sure there is a way around this that would require some settings being changed. That being said, I would tackle the problem by writing a VBA Macro, and linking it to a button that can be pressed. It would not be an 'Automatic' result, like the one you have here (instead requiring a button press when ready), but it would only fire when you are ready for it to.
Thank you so much for the reply.
I have enough trouble with formulas, I don't think I want to tackle VBA yet.
Cheers.
 
Upvote 0
You need to add a cell reference to the CELL function, like
Excel Formula:
=MID(CELL("filename",a1),SEARCH("[",CELL("filename",a1))+1, SEARCH("]",CELL("filename",a1))-SEARCH("[",CELL("filename",a1))-1)
 
Upvote 0
Another option as you have 2021 is
Excel Formula:
=LET(f,CELL("filename",A1),REPLACE(REPLACE(f,FIND("]",f),500,""),1,FIND("[",f),""))
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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