0

i am trying to get the full sheetname dynamically from the address with the below formula in another sheet. is there a better way ?

address : '[Airport - Daily Burn Rate_2024.05.08.xlsx]HQ 2024'!$A$1

result : 'HQ 2024'

my formula :

="'"&MID(TEXTAFTER(CELL("address";'HQ 2024'!A1);"]";1;0);1;
               FIND("~";SUBSTITUTE(TEXTAFTER(CELL("address";'HQ 2024'!A1);"]";1;0);"'";"~";1))
               )

PS if the sheename changes, i dont want my other formula connected to this sheet to be ruined...

2
  • Why have you not used something like this: ="'"&TEXTBEFORE(TEXTAFTER(CELL("address",'HQ 2024'!A1),"]"),"!") Commented May 7 at 14:04
  • 1
    @MayukhBhattacharya i dont know why :) thank you... pls post it as an answer...
    – Umut K
    Commented May 7 at 14:11

3 Answers 3

1

Here is an alternative way, one could try using TEXTBEFORE() and TEXTAFTER():

enter image description here


="'"&TEXTBEFORE(TEXTAFTER(CELL("address",'HQ 2024'!A1),"]"),"!")
0

Why don't you use Formula Evaluation, which can be found in ribbon "Formulas", chapter "Formula Auditing", "Evaluate Formula", like in the following screenshot:

enter image description here

By evaluating step by step, you can see where it goes wrong.

Here, e.g. you can see that the problem is caused by the CELL("address";'HQ 2024'!A1) function, which returns the address of your cell, but not the content.

1
  • there is no problem actually, my formula is working... i wanted to search for a simplier formula...
    – Umut K
    Commented May 7 at 14:15
0

I use:

This in cell DA1 to get the sheet name:

MID(CELL("filename",A1),FIND("]",CELL("filename",A1),1)+1,50)

uses the position of the "]", and then:

This to get a list of all the sheets between the firstone and lastone, as there are other sheets I do not want listed:

TEXTSPLIT(TEXTJOIN(",", FALSE,Firstsheet:Lastsheet!DA1),",")
7
  • thank you for the answer but filename returns #VALUE error in my excel, that's why i have to use address instead...
    – Umut K
    Commented May 12 at 8:33
  • Did you put "filename" in quotes? or is the word different in your language? it is an argument to the cell() function.
    – Solar Mike
    Commented May 12 at 8:35
  • although it show "filename" in the quote of the formula help, it returns error...
    – Umut K
    Commented May 12 at 8:37
  • Well, I think you are making an error that you have not realized, what I posted works correctly.
    – Solar Mike
    Commented May 12 at 9:27
  • there is nothing wrong with the syntax... check the video
    – Umut K
    Commented May 12 at 10:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.