Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to combine 2 or more chart types in a single chart in Excel
  • How to calculate average last N values in a table in Excel
  • How to count table columns in Excel
  • What-If Analysis: Scenarios and Goal Seek in Excel
  • Chart Axes in Excel

References

  • Count unique text values with criteria
  • Count rows with at least n matching values
  • How to reference named range different sheet in Excel
  • Two-way lookup with VLOOKUP in Excel
  • Offset in Excel

Data Validations

  • How To Create Drop-down List in Excel
  • Prevent invalid data entering in specific cells
  • Excel Data validation with conditional list
  • Excel Data validation allow weekday only
  • Excel Data validation exists in list

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:

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:

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,"[","")

 

Post navigation

Previous Post:

How to count line breaks in cell in Excel worksheet

Next Post:

How to count total words in a cell 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

Logical Functions

  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • IFS function: Description, Usage, Syntax, Examples and Explanation
  • Nested IF function example in Excel
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • Not Equal To ‘<>‘ operator in Excel

Date Time

  • YEARFRAC function: Description, Usage, Syntax, Examples and Explanation
  • Get days, hours, and minutes between dates in Excel
  • Display Date is workday in Excel
  • How to enter Today’s Date or Static Date and Time in Excel
  • Add days exclude certain days of week in Excel

Grouping

  • If cell contains one of many things in Excel
  • Map text to numbers in Excel
  • Group times into 3 hour buckets in Excel
  • Running count group by n size in Excel
  • How to randomly assign people to groups in Excel

General

  • AutoFit Column Width, AutoFit Row Height in Excel
  • How to calculate total from percentage in Excel
  • How to generate random times at specific intervals in Excel
  • Check if multiple cells have same value in Excel
  • 231 Keyboard Shortcut Keys In Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning