Forum Discussion

aaghd's avatar
aaghd
Copper Contributor
Dec 15, 2023
Solved

Retrieving and Entering the Sheet Name in a Cell

Help says that you can retrieve a sheet name but does not clearly explain the syntax necessary to do so.  I can get it to bring the number of the sheet, but I would like the "Name" of the sheet displayed in one of the sheet cells.

 

Thanks,

  • Hello aaghd,
    you can use this formula to show the sheet name on a certain cell,

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

     

  • Rodrigo_'s avatar
    Rodrigo_
    Steel Contributor

    Hello aaghd,
    you can use this formula to show the sheet name on a certain cell,

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

     

    • aaghd's avatar
      aaghd
      Copper Contributor

      Rodrigo_ 

       

      Thank you for the formula.  It works perfectly.  Your time and attention to my question is greatly appreciated.  Happy Holidays to you!

      • Patrick2788's avatar
        Patrick2788
        Silver Contributor
        That's interesting that the legacy approach to showing the sheet name works. Both solutions use CELL which is not available in Excel web app. Which version are you using?
  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    aaghd 

    If you're in Excel 365, you can use:

    =LET(filename, CELL("filename"), TEXTAFTER(filename, "]", -1))
    • aaghd's avatar
      aaghd
      Copper Contributor
      I have pasted this in the cell where I want the value and I am getting an #Value! I did take out all spaces in the formula you wrote. Please let me know if I have done something wrong. The name on the sheet is "X Borough". Thanks.
      • Patrick2788's avatar
        Patrick2788
        Silver Contributor

        aaghd 

        If you're using Excel for web you'll get a #VALUE! error:

        CELL is not available in the web app.

Resources