Get the Current Sheet Name in a Cell

Excel Formulas › Lookup

All versionsCELLTEXTAFTER

To display the tab’s name in a cell — for a dynamic title or a reference key — pull it out of CELL("filename"), which returns the full path, workbook, and sheet. A little text surgery isolates just the sheet name.


Quick formula: to show the current sheet’s name:
=TEXTAFTER(CELL("filename", A1), "]")
CELL("filename") returns …[Book.xlsx]SheetName; everything after the ] is the sheet name.

Functions used (tap for the full reference guide):

The example

The formula returns whatever the tab is named — rename the tab and it updates.

AB
1FormulaResult
2CELL("filename")…\[Sales.xlsx]Summary
3TEXTAFTER(…, "]")Summary

The formula

Just the sheet name:

=TEXTAFTER(CELL("filename", A1), "]") // returns the tab name, e.g. Summary

How it works

Slice the sheet name out of the full path:

  1. CELL("filename", A1) returns the full file path with the workbook in brackets and the sheet name after them — C:\…[Sales.xlsx]Summary.
  2. The sheet name is everything after the closing bracket ].
  3. TEXTAFTER(…, "]") grabs it directly (Excel 365). In older Excel: =MID(CELL("filename",A1), FIND("]", CELL("filename",A1))+1, 255).
  4. The file must be saved for CELL("filename") to return anything — a brand-new unsaved workbook gives an empty string.

Use it as a dynamic title: ="Report for " & TEXTAFTER(CELL("filename",A1), "]") puts the tab name into a heading that updates automatically when you rename or copy the sheet.

Try it: interactive demo

Live demo

CELL("filename") returns the path; the formula keeps just the tab name.

Sheet name:

Variations

Legacy (MID/FIND)

Any version:

=MID(CELL("filename",A1), FIND("]",CELL("filename",A1))+1, 255)

Get the file name

The bit between the brackets:

=TEXTBEFORE(TEXTAFTER(CELL("filename",A1), "["), "]")

Full path

Everything CELL returns:

=CELL("filename", A1)

Pitfalls & errors

Empty result on an unsaved file. CELL("filename") needs the workbook saved to disk. Save once and it works.

It recalculates workbook-wide. CELL is volatile, so it refreshes on every change. Fine for a few cells, avoid in thousands.

Add the A1 argument. CELL("filename", A1) ties it to this sheet; without a reference it can report the active sheet, which may differ.

Practice workbook

📊
Download the free Get the Current Sheet Name in a Cell practice workbook
The CELL-based sheet-name formula with the legacy MID/FIND and file-name variants (results shown), plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I get the current sheet name in a cell in Excel?
Use =TEXTAFTER(CELL("filename", A1), "]") in Excel 365, or =MID(CELL("filename",A1), FIND("]",CELL("filename",A1))+1, 255) in older versions. The file must be saved.
Why does my sheet-name formula return blank?
CELL("filename") only works once the workbook has been saved to disk. Save the file and the formula will return the tab name.
How do I get the workbook file name instead?
Take the text between the brackets: =TEXTBEFORE(TEXTAFTER(CELL("filename",A1), "["), "]").

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: List all sheet names · Build references with INDIRECT · Build clickable links (HYPERLINK)

Function references: CELL · MID · FIND