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

Data Analysis

  • Excel Bar Chart
  • How to calculate current stock or inventory in Excel
  • Error Bars in Excel
  • Randomize/ Shuffle List in Excel
  • How to create running total in an Excel Table

References

  • Complete List of Excel Lookup and Reference Functions, References and Examples
  • How to get first column number in range in Excel
  • How to get last column number in range in Excel
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • Convert text string to valid reference in Excel using Indirect function

Data Validations

  • Excel Data validation number multiple 100
  • Excel Data validation must contain specific text
  • Excel Data validation must begin with
  • How To Create Drop-down List in Excel
  • Data validation must not exist in list

How to get Excel workbook path only

by

If you want to get the workbook path (directory) only, you can do so with a formula that uses the LEFT and the FIND function. The result will look something like this:

Drive:\path\to\file\   //Windows
Drive:path:to:file:    //Mac

Formula

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

Explanation

How the formula works

The cell function is used to get the full file name and path:

CELL("filename",A1)

The result looks like this:

path[workbook.xlsm]sheet

The full file name and path are fed into the LEFT function, which is used to extract just the full directory path.

The number of characters to extract by locating the the position of the left square bracket “[” with FIND and subtracting 1:

FIND("[",CELL("Filename",A1))-1

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

  • How to use Excel NOT Function
  • IF with wildcards in Excel
  • How to use Excel FALSE Function
  • Complete List of Excel Logical Functions, References and Examples
  • IF function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Get fiscal quarter from date in Excel
  • How to determine year is a leap year in Excel
  • Get age from birthday in Excel
  • Pad week numbers with zeros in Excel
  • Excel Date & Time Functions Example

Grouping

  • Group numbers with VLOOKUP in Excel
  • How to randomly assign data to groups in Excel
  • Map inputs to arbitrary values in Excel
  • Group numbers at uneven intervals in Excel
  • Categorize text with keywords in Excel

General

  • How to Delete Cells, Row and Rows in Excel
  • How to calculate project complete percentage in Excel
  • How to increase by percentage in Excel
  • Find, Select, Replace and Go To Special in Excel
  • How to Insert Cells, Row and Rows in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning