Yes. In Excel for Microsoft 365 on Windows, enter =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255) in a cell on the worksheet whose name you want; it returns that sheet’s tab name once the workbook has been saved. The formula extracts the text after the closing bracket in the file path returned by CELL.
Formula to Return the Current Sheet Name
Suppose you want a worksheet to display its own tab name in cell B1. Enter the formula there, or in any other cell on that worksheet. A1 is simply a reference to a cell on the current sheet; it does not need to contain data. The formula returns the worksheet name, not the workbook’s file name or the full file path.
For example, if the saved workbook is named Quarterly Report.xlsx and the current tab is North Region, CELL(“filename”,A1) returns a string containing the file location, workbook name, and worksheet name. FIND locates the closing square bracket after the workbook name. MID then extracts the characters that follow it, up to 255 characters. Excel worksheet names are limited to 31 characters, so 255 is ample.
To return the name of a different worksheet, point CELL to a cell on that sheet. Assume a saved workbook contains a tab named North Region, and you enter this formula on another sheet; it returns North Region:
=MID(CELL("filename",'North Region'!A1),FIND("]",CELL("filename",'North Region'!A1))+1,255)
The single quotes around the sheet name are needed because it contains a space. For a simple sheet name without spaces or special characters, Excel may not require them, but quotes make the reference clear. If the target tab is renamed, Excel normally updates the reference; if the target sheet is deleted, the formula can return a reference error.
Why the Formula Works
Excel does not provide a standard worksheet function called SHEETNAME that simply returns the current tab’s displayed name. Instead, the formula uses CELL with the information type “filename”. That information type returns workbook location details along with the worksheet name, provided Excel has a saved file location to report.
The formula’s parts have distinct jobs:
CELL("filename",A1)asks Excel for the path, workbook name, and sheet name associated with A1.FIND("]",...)identifies the position of the closing bracket that ends the workbook name.MID(...,...+1,255)starts one character after that bracket and returns the remaining text, which is the tab name.
The formula is not reading the tab’s color, position, or other properties. It reads the sheet name embedded in the filename information string. This is why saving matters: before a workbook has a file location, there may be no filename string from which Excel can extract the tab name.
Set It Up Step by Step
- Save the workbook with Ctrl+S on Windows. If it has not been saved before, choose a location and file name.
- Click the worksheet whose tab name you want to display.
- Select a cell for the result, such as B1, and enter the formula.
- Press Enter. The cell should show the current worksheet name.
- Copy the formula to other worksheets if each sheet should show its own name. Because A1 is an unqualified reference, it refers to A1 on each destination sheet.
On a Mac, the formula itself is the same, and Command+S saves the workbook. Excel for the web may not return the filename information in the same way as the desktop app, so check the result there rather than assuming the formula will behave identically. If the workbook is unsaved, save it first; if it still does not work in the browser, open it in the desktop version of Excel.
To make a label more visible, format the result cell with a larger font, bold text, or a fill color. Those are ordinary cell-formatting choices and do not affect how the formula calculates. You can also put the result in a header area, provided the formula is entered in a worksheet cell; worksheet headers and footers have different editing and formula behaviors.
Important Limits and Common Problems
The most common issue is a blank result in a new, unsaved workbook. Save the file, then recalculate if necessary. In normal automatic calculation mode, Excel updates formulas as workbook values change. If a name appears stale after a tab rename, use Formulas > Calculate Now, or press F9 on Windows, to request recalculation. In manual calculation mode, formula results do not necessarily refresh immediately.
Other likely causes or misunderstandings include:
- Expecting the file name: the formula returns the sheet name after the closing bracket, not the workbook name. A result such as North Region is expected even when the file is called Quarterly Report.xlsx.
- Using the wrong reference: A1 refers to the current sheet only when it is unqualified. A reference such as ‘North Region’!A1 deliberately asks for the name of that other sheet.
- Copying the formula as text: if the cell is formatted as Text before entry, Excel may show the formula characters instead of calculating them. Change the cell format to General and re-enter the formula.
- Seeing an error: CELL(“filename”,A1) can return an empty string before the workbook is saved. A formula built around that empty result may consequently display nothing or an error, depending on the calculation.
- Using the formula in another spreadsheet program: functions and filename behavior can differ between Excel and other spreadsheet applications.
Sheet names cannot contain certain characters, including a closing bracket, so the extraction method is not confused by a bracket within a valid tab name. It does, however, rely on Excel’s filename string having the expected workbook-and-sheet structure. If a workbook is opened from an unusual location or used in a browser, confirm the output on the version and storage setup you use.
Use the Sheet Name in Labels and Other Formulas
A sheet-name formula is useful when a workbook contains repeated report layouts. For example, a regional report can show its tab name at the top of the page, reducing the chance that someone prints a page without knowing which region it represents. The same idea can help identify monthly worksheets, department schedules, or project tabs.
Because the returned name is text, it can be combined with other text or used as an input to another formula. That makes it possible to build a heading such as “Current report: North Region” or to create a visible identifier for a template. Be mindful that a worksheet name can change: any label built from the formula changes after recalculation, which is usually helpful but may not be appropriate if you need a permanent historical record.
The formula does not automatically create a list of every worksheet in the workbook. It returns the name associated with the reference you give CELL. Nor does it find a tab by matching a value in a cell. If your goal is to show the name of whichever sheet contains a particular record, that is a different task and may require a lookup or a designed index, depending on how the workbook is organized.
For a printed report, check the result in Print Preview after changing a tab name. A correct cell value can still be clipped by narrow columns, hidden rows, or print-area settings. The formula supplies the text; normal layout and printing settings determine whether readers can see it.
Alternatives and Comparisons
If a tab name rarely changes, typing it into a cell is the simplest option. Manual text does not require a saved workbook and will not depend on CELL’s filename information. The tradeoff is that it will not update when the tab is renamed, so the displayed name can become inaccurate.
For automated workbook behavior, VBA can provide custom functions or write sheet names into cells, but it requires enabling macros and maintaining code. A macro that writes a value also differs from a formula: the written value will not necessarily update after a rename unless the macro runs again. Save a copy before running any macro because changes made by VBA cannot be undone with Ctrl+Z.
There are also legacy Excel 4 macro functions sometimes used through defined names to list or inspect worksheet information. They are not ordinary modern worksheet functions, and setup, compatibility, and security considerations make them less straightforward than the CELL formula for a single current-sheet name. For most users who need one visible tab name, the formula above is the simplest formula-based approach.
Choose based on how the workbook will be maintained. Use the CELL formula when the name should follow a saved worksheet and update with recalculation. Use typed text when a fixed label is intentional. Consider VBA or a more specialized design only when you need broader automation, such as producing a list of all sheet names.
Frequently Asked Questions
Does the formula update when I rename a tab?
It should return the new name after Excel recalculates the formula. If the old name remains visible, check calculation mode and use Formulas > Calculate Now or F9 on Windows.
Why does the formula return blank in a new workbook?
CELL(“filename”,A1) needs a saved workbook location to return the filename information used by the formula. Save the workbook, then let Excel recalculate.
Can I show the name of a different sheet?
Yes. Use a cell reference qualified with the target tab name, such as ‘North Region’!A1. The formula will return that sheet’s name rather than the name of the sheet where the formula is entered.
Does this return the workbook file name too?
No. The formula extracts only the text after the workbook name’s closing bracket, which is the worksheet name. CELL(“filename”,A1) itself contains more information, but MID returns just the tab name.
Can I use this in Excel for the web?
Behavior can differ from Excel for Microsoft 365 on Windows, particularly around filename information. If the formula does not return the expected name in the browser, save the file and try it in the desktop app.
Related
- Data Validation Framework: Design, Rules, and Examples
- What Is Power Query? Excel Data Cleanup Explained
- AI and Power Query: What It Can and Cannot Do in Excel
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- EDATE in Excel: Add Months to a Date, With ExamplesTo add calendar months to a date in Excel, use =EDATE(start_date, months). For example, with a date in…
- Excel AND Function in an IF Statement: How It WorksYes. In Excel, put AND inside IF when the result should depend on several conditions being true at…
- Excel Formula for Row Number: ROW and ROWS ExplainedTo return the worksheet row number of the cell containing a formula, use =ROW(). To return the row…
- Excel Date Minus Months: Formulas and ExamplesTo subtract calendar months from a date in Excel, use EDATE with a negative month count. If the…
- Excel Filter and Sort by Color: Steps, Options, and TipsIn Excel for Microsoft 365 on Windows, use the filter arrow in a column and choose Filter by…
- SUMPRODUCT in Excel: Multiple Criteria ExplainedYes. In Excel, SUMPRODUCT can sum values that meet multiple criteria by multiplying TRUE/FALSE tests together; for example,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.