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

Data Analysis

  • Chart Axes in Excel
  • Data Series in Excel
  • Excel Bar Chart
  • Get column name from index in Excel Table
  • How to conditionally sum numeric data in an Excel table using SUMIFS

References

  • How to reference named range different sheet in Excel
  • Approximate match with multiple criteria in Excel
  • Merge tables with VLOOKUP in Excel
  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • VLOOKUP function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Excel Data validation only dates between
  • Excel Data validation with conditional list
  • Excel Data validation require unique number
  • Excel Data validation unique values only
  • Excel Data validation exists in list

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.

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

Post navigation

Previous Post:

DECIMAL function: Description, Usage, Syntax, Examples and Explanation

Next Post:

AVERAGE function: Description, Usage, Syntax, Examples and Explanation

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

  • SWITCH function example in Excel
  • Excel If, Nested If, And/Or Criteria Examples
  • How to use Excel NOT Function
  • How to return blank in place of #DIV/0! error in Excel
  • IFERROR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • DATEDIF function: Description, Usage, Syntax, Examples and Explanation
  • Get work hours between dates custom schedule in Excel
  • Assign points based on late time in Excel
  • How to calculate project start date based on end date in Excel
  • Get first Monday before any date in Excel

Grouping

  • Group times into 3 hour buckets in Excel
  • Group arbitrary text values in Excel
  • How to randomly assign data to groups in Excel
  • How to randomly assign people to groups in Excel
  • Group numbers with VLOOKUP in Excel

General

  • AutoRecover file that was never saved in Excel
  • Delete Blank Rows at Once in Excel
  • How to count total number of cells in a rectangular range in Excel
  • Convert column number to letter in Excel
  • How to password protect excel sheet?
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning