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

Lookup and Reference Examples

  • Vlookup Examples in Excel
  • Extract all partial matches in Excel
  • How to use Excel OFFSET function
  • Convert text string to valid reference in Excel using Indirect function
  • Perform case-sensitive Lookup in Excel

Data Analysis Examples

  • How To Remove Duplicates In Excel Column Or Row?
  • How to calculate correlation coefficient Correlation in Excel
  • How to count table rows in Excel
  • How to sum a total in multiple Excel tables
  • How to Use Solver Tool in Excel

Data Validation Examples

  • Excel Data validation specific characters only
  • Excel Data validation number multiple 100
  • Prevent invalid data entering in specific cells
  • Excel Data validation must not contain
  • Excel Data validation date in next 30 days

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:   Excel Data validation must begin with

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 check worksheet name exists in Excel

Next Post:

How to reference named range different sheet 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
  • How to calculate Number of Instances in Excel
  • REPLACE, REPLACEB functions: Description, Usage, Syntax, Examples and Explanation
  • Remove leading and trailing spaces from text in one or more cells in Excel
  • How to display conditional message with REPT function in Excel
  • How to check if cell contains some words but not others in Excel
  • Count birthdays by month in Excel
  • HOUR function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate Quarter of Date in Excel
  • Basic timesheet formula with breaks in Excel
  • How to join date and text together in Excel
  • How to Calculate Tax Rates in Excel
  • COUPDAYSNC function: Description, Usage, Syntax, Examples and Explanation
  • COUPNUM function: Description, Usage, Syntax, Examples and Explanation
  • PMT, RATE, NPER, PV and FV Financial Functions in Excel
  • MDURATION function: Description, Usage, Syntax, Examples and Explanation
© 2022 xlsoffice . All Right Reserved. | Teal Smiles