CELL Formula Behavior

dsipp

New Member
Joined
Sep 17, 2011
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I use this formula to but the file name in a cell. =MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1).
This works perfectly. I then use another formula in a different cell to parse out a value from filename =MID(J1,FIND("e_0",J1)+3,2). This also works perfectly. Until I open a second excel workbook. the CELL formula up[dates in workbook A with the file name of workbook B and then the dominoes fall. I hit F9 and the name corrects but I am curious about the behavior.
Is this expected behavior? why? seems wrong. Ideas?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
You should always include a cell reference in the CELL formula unless you actually want the behaviour you are getting. Without one, it is evaluated in the context of the last altered/evaluated cell.
 
Upvote 0
Not clear on your response. What would I reference? Do you have an example of what you mean? Thank you for the response.
 
Upvote 0
Any cell in the workbook you are interested in - for example:

=MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1, SEARCH("]",CELL("filename",A1))-SEARCH("[",CELL("filename",A1))-1)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Any cell in the workbook you are interested in - for example:

=MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1, SEARCH("]",CELL("filename",A1))-SEARCH("[",CELL("filename",A1))-1)
I am not referencing any cell. The original formula is in J1. That is irrelevant as it could be anywhere. The second formula is where I ultimately want the result. I could wrap it all in one formula. As it stands today, the original formula is in J1. it returns the file name in J1 (as long as it is the only workbook open) then the second formula parses J1 to get the value I need in C1.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Been a long time since I have been on the forum. thanks for the reminder. I have updated the profile. I am using 365.
 
Upvote 0
I am not referencing any cell. The original formula is in J1. That is irrelevant as it could be anywhere. The second formula is where I ultimately want the result. I could wrap it all in one formula. As it stands today, the original formula is in J1. it returns the file name in J1 (as long as it is the only workbook open) then the second formula parses J1 to get the value I need in C1.
I updated the formula to reference J1. this seems to solve the issue. Thanks for the kind response. Do you have and explanation of why this would behave this way? I mean what is a use case where one would want the name to update?
 
Upvote 0
If you have the new functions, you could change your formula to
Excel Formula:
=TAKE(TEXTSPLIT(CELL("filename",J1),"[","]"),1,-1)
 
Upvote 0
what is a use case where one would want the name to update
Any time you want information based on the last changed cell - remember there are a lot of other arguments to CELL than "filename".
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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