Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • VLOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • Excel Advanced Lookup using Index and Match Functions
  • Two-way lookup with VLOOKUP in Excel
  • How to use Excel LOOKUP Function
  • How to use Excel TRANSPOSE Function

Data Analysis Examples

  • Conditional Formatting New Rule with Formulas in Excel
  • How To Sort One Column or Multiple Columns in Excel
  • How to calculate correlation coefficient Correlation in Excel
  • Managing Conditional Formatting Rules in Excel
  • How to Create Thermometer Chart in Excel

Data Validation Examples

  • Data validation must not exist in list
  • Excel Data validation unique values only
  • Excel Data validation only dates between
  • Prevent invalid data entering in specific cells
  • Excel Data validation don’t exceed total

Get workbook name and path without sheet in Excel

by

If you want to get the current workbook’s full name and path without a sheet name, you can use a formula that employs several text functions to strip off the sheet name. The final result will be a text string that looks like this:

Worked Example:   Basic outline numbering in Excel
path[workbook.xlsm]

Formula

=SUBSTITUTE( LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","")

Explanation

How the formula works

The CELL function is used with “filename” to get the full workbook name and path:

CELL("filename",A1)

The result is a full path that looks like this:

Worked Example:   How to extract substring in Excel
path[workbook.xlsm]sheetname

The LEFT function receives the full path as text, along with the the location of square bracket “]” (minus 1) which is calculated by the find function:

FIND("]",CELL("filename",A1))

With these arguments, LEFT effectively strips off the sheet name out of the path. However, the left square bracket “]” remains:

path[workbook.xlsm

The final function, SUBSTITUTE, removes the “]” by replacing it with an empty string (“”).

=SUBSTITUTE(path[workbook.xlsm,"[","")

 

Worked Example:   Split text and numbers in Excel

Post navigation

Previous Post:

How to get sheet name only in Excel

Next Post:

How to check worksheet name exists in Excel

Leave a Reply Cancel reply

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

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • CHAR function: Description, Usage, Syntax, Examples and Explanation
  • How to get top level domain (TLD) in Excel
  • DBCS function: Description, Usage, Syntax, Examples and Explanation
  • Normalize text by removing punctuations, extra spaces and more in Excel
  • TEXTJOIN function: Description, Usage, Syntax, Examples and Explanation
  • Convert decimal seconds to Excel time
  • Calculate days remaining in Excel
  • Add months to date in Excel
  • TODAY function: Description, Usage, Syntax, Examples and Explanation
  • Custom weekday abbreviation in Excel
  • Calculate cumulative loan principal payments in Excel
  • DOLLARFR function: Description, Usage, Syntax, Examples and Explanation
  • Calculate cumulative loan interest in Excel
  • Calculate payment periods for loan in Excel
  • AMORLINC function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles