» Cell Function Returns Sheet Name, Workbook Name and Path
CATEGORY - Excel Tools
VERSION - All Microsoft Excel Versions
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)

Book Store:
Recommended Books:
- Microsoft Windows XP Inside Out
- Microsoft Excel VBA Programming for the Absolute Beginner
- Millionaire Real Estate Mentor : The Secrets of Financial Freedom through Real Estate Investing
- Financial Shenanigans : How to Detect Accounting Gimmicks & Fraud in Financial Reports
- Successful Business Planning in 30 Days: A Step-By-Step Guide for Writing a Business Plan and Starting Your Own Business
- How to Read A Financial Report
missing parenthesis
immyjimmy Posted on: 31-12-1969
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.Workbook Name function
Buzz Posted on: 31-12-1969
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)
Workbook Sheet name
DAn Posted on: 31-12-1969
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 nameWorkbook Name Function
lkb Posted on: 31-12-1969
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. The fuction returns same value everywhere
Prabs81 Posted on: 31-12-1969
The functions listed here return same value if these are used in more than one worksheet or workbook...proper worksheet name on each sheet
HB Posted on: 31-12-1969
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.
Error in "Worksheet function that returns the workbook name"
Louie Hui Posted on: 31-12-1969
Hello:
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)


