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

Data Analysis

  • Chart Axes in Excel
  • Conditional Formatting Data bars Examples in Excel
  • How to Use Solver Tool in Excel
  • How to Create Column Chart in Excel
  • Understanding Pivot Tables in Excel

References

  • How to get relative column numbers in a range in Excel
  • How to use Excel INDIRECT Function
  • Multi-criteria lookup and transpose in Excel
  • Two-column Lookup in Excel
  • How to use Excel ROWS Function

Data Validations

  • Prevent invalid data entering in specific cells
  • Excel Data validation must begin with
  • Excel Data validation whole percentage only
  • How To Create Drop-down List in Excel
  • Excel Data validation with conditional 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.

Worked Example:   Highlight cells that contain in Excel

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

  • IFERROR function: Description, Usage, Syntax, Examples and Explanation
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel OR Function
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • Nested IF function example in Excel

Date Time

  • Custom weekday abbreviation in Excel
  • Steps to create Dynamic calendar grid in Excel
  • TIME function: Description, Usage, Syntax, Examples and Explanation
  • Convert text timestamp into time in Excel
  • Get days between dates ignoring years in Excel

Grouping

  • If cell contains one of many things in Excel
  • How to randomly assign data to groups in Excel
  • Group times into unequal buckets in Excel
  • Group numbers at uneven intervals in Excel
  • Group numbers with VLOOKUP in Excel

General

  • Creating and Opening an existing file in Excel
  • How to calculate percentage of total in Excel
  • How to calculate percentage discount in Excel
  • Cell References: Relative, Absolute and Mixed Referencing Examples
  • Basic error trapping example in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning