Cell Function Returns Sheet Name, Workbook Name and Path





The Cell function returns information about the formatting, location, or contents of the upper-left cell in a reference.

To get the sheet name:
=MID(CELL(“filename”),FIND(“]”,CELL(“filename”))+1,255)

To get the workbook name:
=MID(CELL(“filename”),FIND(“[",CELL("filename"))+1,(FIND("]“,CELL(“filename”))+1)-FIND(“[“,CELL(“filename”))-2)

To get the path address & workbook name:
=CELL(“filename”)

To get the path address:
=MID(CELL(“filename”),1,FIND(“[“,CELL(“filename”))-1)
Screenshot // Cell Function Returns Sheet Name, Workbook Name and Path
Cell Function Returns Sheet Name, Workbook Name and Path



13 thoughts on “Cell Function Returns Sheet Name, Workbook Name and Path

  1. The formula listed here: =MID(CELL(“filename”),1,FIND(“[",CELL("filename"))+1, FIND("]“,(CELL(“filename”))-FIND(“[“,CELL(“filename”))-1) seems to be missing a closing parenthesis.

  2. The following function works correctly to return the workbook name: =MID(CELL(“filename”),FIND(“[",CELL("filename"))+1,(FIND("]“,CELL(“filename”))+1)-FIND(“[“,CELL(“filename”))-2)

  3. the function =MID(CELL(“filename”),FIND(“]”,CELL(“filename”))+1,255) seems to be a global function. Putting multiple instaces of this function on separte sheets, always returns the same name

  4. I can’t get this formula to work, but this formula has 8 functions in the argument, I thought you could only have 7 functions in the formula.

  5. “the function =MID(CELL(“”filename””),FIND(“”]””,CELL(“”filename””))+1,255) returns the same value on each sheet unless you add a cell reference after “”filename””.
    the formula should look like this when done:
    =MID(CELL(“”filename””,b1),FIND(“”]””,CELL(“”filename””,b1))+1,255)
    By adding a cell reference after filename, the value returned should be the worksheet name of the proper worksheet and not the same value for all worksheets.”

  6. The formula listed here: =MID(CELL(“filename”),1,FIND(“[",CELL("filename"))+1, FIND("]“,(CELL(“filename”))-FIND(“[“,CELL(“filename”))-1) seems to be missing a closing parenthesis.

  7. “The following function works correctly to return the workbook name:
    =MID(CELL(“”filename””),FIND(“”["",CELL(""filename""))+1,(FIND(""]“”,CELL(“”filename””))+1)-FIND(“”[“”,CELL(“”filename””))-2)”

  8. the function =MID(CELL(“filename”),FIND(“]”,CELL(“filename”))+1,255) seems to be a global function. Putting multiple instaces of this function on separte sheets, always returns the same name

  9. I can’t get this formula to work, but this formula has 8 functions in the argument, I thought you could only have 7 functions in the formula.

  10. “the function =MID(CELL(“”filename””),FIND(“”]””,CELL(“”filename””))+1,255) returns the same value on each sheet unless you add a cell reference after “”filename””.

    the formula should look like this when done:
    =MID(CELL(“”filename””,b1),FIND(“”]””,CELL(“”filename””,b1))+1,255)

    By adding a cell reference after filename, the value returned should be the worksheet name of the proper worksheet and not the same value for all worksheets.”

  11. “Thank you for your information, I found it very useful. There is small error in this formula. “”Worksheet function that returns the workbook name:””

    The corrected one should read as follow

    =MID(CELL(“”filename””),FIND(“”["",CELL(""filename""))+1,FIND(""]“”,CELL(“”filename””))-FIND(“”[“”,CELL(“”filename””))-1) “

Leave a Reply

Your email address will not be published. Required fields are marked *


− two = 3

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>