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

Lookup and Reference Examples

  • MATCH function: Description, Usage, Syntax, Examples and Explanation
  • Extract data with helper column in Excel
  • Convert text string to valid reference in Excel using Indirect function
  • Get nth match with INDEX / MATCH in Excel
  • How to use Excel TRANSPOSE Function

Data Analysis Examples

  • Remove Duplicates Example in Excel
  • How to calculate current stock or inventory in Excel
  • Randomize/ Shuffle List in Excel
  • How To Sort One Column or Multiple Columns in Excel
  • How to create running total in an Excel Table

Data Validation Examples

  • Excel Data validation unique values only
  • Excel Data validation exists in list
  • Prevent invalid data entering in specific cells
  • Excel Data validation must not contain
  • Excel Data validation don’t exceed total

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:   Create dynamic workbook reference to another workbook 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:   Split dimensions into three parts 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
  • How to find and replace multiple values at same time in Excel
  • Get first name from full name — Manipulating NAMES in Excel
  • How to calculate Number of Instances in Excel
  • Join cells with comma in Excel
  • Find function vs Search function in Excel
  • Pad week numbers with zeros in Excel
  • Display Date is same month in Excel
  • Count birthdays by month in Excel
  • Get last day of month in Excel
  • Add decimal minutes to time in Excel
  • XNPV function: Description, Usage, Syntax, Examples and Explanation
  • CUMIPMT function: Description, Usage, Syntax, Examples and Explanation
  • DOLLARFR function: Description, Usage, Syntax, Examples and Explanation
  • DB function: Description, Usage, Syntax, Examples and Explanation
  • Calculate loan interest in given year in Excel
Acronyms, Abbreviations, Initialism & What They Stand For
© 2022 xlsoffice . All Right Reserved. | Teal Smiles