How to Get the Current Sheet Name in Microsoft Excel Using the CELL Function

When creating complex financial models, consolidated audit reports, or dynamic dashboard templates in Microsoft Excel, you often need formulas to reference the name of the current worksheet tab automatically. Hard-coding tab names into header cells or summary formulas requires manual editing every time a tab is renamed, duplicated, or rolled forward into a new reporting cycle.

Excel does not have a single dedicated function named =SHEETNAME(). Instead, you can extract the exact name of any worksheet dynamically by combining the built-in CELL information function with text-parsing functions like TEXTAFTER or legacy formulas using MID and FIND. This guide explains how to construct dynamic sheet name formulas in Microsoft Excel across both modern Microsoft 365 environments and legacy versions.

Understanding How the CELL Function Retrieves File Information

The foundation of dynamic sheet name extraction is the CELL function. When you pass the "filename" argument into CELL, Excel returns the full operating system filepath, workbook filename, and worksheet tab name formatted as a single composite string:

=CELL("filename", A1)

When evaluated in a saved Excel workbook, this formula outputs a text string structured like this:

C:\Users\Username\Documents\[Financial_Model.xlsx]Q3_Revenue

Notice the critical structural landmark: the workbook filename is enclosed in square brackets ([...]), and the worksheet tab name always follows immediately after the closing square bracket (]). By extracting all text following that closing bracket, you isolate the worksheet name.

Crucial Requirement: The workbook must be saved to your local drive, OneDrive, or SharePoint before CELL("filename") will return a value. In a newly created, unsaved workbook, the formula returns an empty text string ("") because no filename exists yet.

Excel Version Recommended Formula Primary Advantage
Microsoft 365 & Excel 2024 / 2021 =TEXTAFTER(CELL("filename", A1), "]") Concise, readable, zero nested math or length calculations
Excel 2019, 2016, 2013 & Older =MID(CELL("filename", A1), FIND("]", CELL("filename", A1)) + 1, 255) Universal backwards compatibility with all legacy versions

Method 1: Extract Sheet Name Using TEXTAFTER (Modern Excel)

If you are using Microsoft 365, Excel for the Web, or Excel 2021/2024, the modern TEXTAFTER function provides the cleanest and most reliable syntax:

  1. Open your saved Excel spreadsheet.
  2. Click into the target cell where you want the tab name displayed (e.g. cell A1 or B2).
  3. Enter the following formula:
    =TEXTAFTER(CELL("filename", A1), "]")
  4. Press Enter.

The formula inspects the filename string returned by CELL, locates the closing square bracket ], and extracts every character that appears after it. If you right-click the worksheet tab and rename it (e.g. from “Sheet1” to “October_Summary”), press F9 or recalculate the workbook, and the cell updates automatically.

Method 2: Extract Sheet Name Using MID and FIND (Legacy Excel)

If your spreadsheet must remain compatible with coworkers or clients running older standalone builds of Excel (such as Excel 2016 or 2019), use the classic combination of MID and FIND:

  1. Select your target cell.
  2. Enter the following formula:
    =MID(CELL("filename", A1), FIND("]", CELL("filename", A1)) + 1, 255)
  3. Press Enter.

How this legacy formula operates:

  • FIND("]", CELL("filename", A1)) pinpoints the exact numerical character position of the closing bracket.
  • Adding + 1 shifts the starting position to the very first letter of the sheet name.
  • MID(..., start_num, 255) extracts up to 255 characters starting from that position. Because Excel limits worksheet tab names to a maximum of 31 characters, a length parameter of 255 guarantees the complete sheet name is captured without truncation.

Why Including the Cell Reference (A1) is Mandatory

A common error when writing sheet name formulas is omitting the second argument, writing simply =CELL("filename"). While this syntax works initially, Excel evaluates an unreferenced CELL function based on whichever cell was most recently edited or recalculated across the entire workbook.

If you view Sheet 2 and trigger a calculation, an unreferenced formula on Sheet 1 will unexpectedly display “Sheet 2”. Specifying a local reference within the current sheet—such as A1—binds the function strictly to that worksheet tab, preventing cross-sheet bleed during calculations.

Referencing Another Worksheet Tab Name Dynamically

You can also use this technique to extract the tab name of a different sheet within the same workbook. Simply pass a cell reference residing on that target sheet into the formula:

=TEXTAFTER(CELL("filename", 'Q1_Summary'!A1), "]")

Even if another team member renames the “Q1_Summary” tab, Excel automatically updates the internal sheet reference in the formula, keeping your header labels and dynamic titles perfectly synchronised.

Mastering dynamic sheet name extraction ensures your Microsoft Excel financial models, template workbooks, and report headers remain resilient against manual renaming errors.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.