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

Lookup and Reference Examples

  • How to get address of named range in Excel
  • How to use Excel MATCH Function
  • How to get address of first cell in range in Excel
  • Excel Advanced Lookup using Index and Match Functions
  • Last row number in range

Data Analysis Examples

  • How to count table rows in Excel
  • Excel Pie Chart
  • How To Compare Two Lists in Excel
  • Excel Bar Chart
  • Number and Text Filters Examples in Excel

Data Validation Examples

  • Excel Data validation date in specific year
  • Prevent invalid data entering in specific cells
  • Excel Data validation no punctuation
  • Excel Data validation require unique number
  • Excel Data validation must contain specific text

How to retrieve workbook name only in Excel

by

If you want to get the workbook name only (i.e. the file name without path or sheet name) you can do so with a rather long formula that uses the MID function along with the FIND function.

Worked Example:   How to extract name from email address in Excel

Formula

=MID(CELL("filename",A1),FIND("[",CELL
("filename",A1))+1,FIND("]",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]sheetname

At the highest level, the MID function simply extracts the file name from the path and sheet. The starting position is calculated with FIND:

FIND("[",CELL("filename",A1))+1

The number of characters to extract is also calculated with FIND:

FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1
Worked Example:   AutoRecover file that was never saved in Excel

Post navigation

Previous Post:

How to get full workbook name and path in Excel

Next Post:

Create dynamic workbook reference to another workbook 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
  • Find function vs Search function in Excel
  • How to get last word in a cell in Excel
  • CODE function: Description, Usage, Syntax, Examples and Explanation
  • How to display conditional message with REPT function in Excel
  • How to extract name from email address in Excel
  • Check If Two Dates are same month in Excel
  • Get day name from date in Excel
  • DATEVALUE function: Description, Usage, Syntax, Examples and Explanation
  • Get month name from date in Excel
  • Convert Excel time to decimal minutes
  • PMT, RATE, NPER, PV and FV Financial Functions in Excel
  • DDB function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate compound interest in Excel
  • Calculate interest for given period in Excel
  • CUMIPMT function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles