Excel Formula Tab Name Based on Cell Value

If you just need to excel formula tab name based on cell value and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use =TEXTAFTER(CELL("filename", A1), "]") on Microsoft 365, or =MID(CELL("filename",A1), FIND("]", CELL("filename",A1))+1, 255) in any version — and save the file first, because CELL("filename") returns an empty string until it has been saved.

On this page7
Annotated stepsExcel
1

Save the workbook — CELL("filename") returns an empty string until the file exists on disk.

2

On Microsoft 365: =TEXTAFTER(CELL("filename", A1), "]").

3

On older versions: =MID(CELL("filename",A1), FIND("]", CELL("filename",A1))+1, 255).

4

Always pass the second argument (A1). Without it the result follows the last-calculated sheet, not this one.

5

For the file name instead: =TEXTBEFORE(TEXTAFTER(CELL("filename",A1),"["),"]").

6

Wrap it in IFERROR if the workbook may be used before its first save.

=TEXTAFTER(CELL("filename", A1), "]")
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

Excel has no SHEETNAME function. The only route is CELL("filename", A1), which returns the full path in the form C:\Reports\[Budget.xlsx]January — path, file name in square brackets, then the sheet name. Everything after the closing bracket is the sheet name, so the formula is one text extraction. Three details decide whether it works. The second argument matters: CELL("filename") with no reference returns the name of whichever sheet was last calculated, which on a multi-sheet workbook gives the wrong answer at unpredictable times — always pass a cell on the sheet you mean, such as A1. The workbook must have been saved at least once, or the function returns "". And CELL is volatile, so it recalculates on every change in the workbook; on a sheet with hundreds of these it is worth noticing. To get the file name instead, take the text between the brackets; to list every sheet name, Power Query or a small macro is the practical route. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “excel formula tab name based on cell value”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the tool above before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a layout choice that keeps the sheet readable and sortable, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

On a sheet named January in Budget.xlsx: =CELL("filename", A1) returns C:\Reports\[Budget.xlsx]January. =TEXTAFTER(CELL("filename", A1), "]") returns January. Rename the tab to Jan-2026 and the cell updates by itself, which is why a report header built this way can never disagree with the tab it sits on. A report header that reads its own tab name cannot go stale, which is exactly what a typed one does the first time someone renames the sheet. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

References to another workbook do not carry over: Excel's [Workbook.xlsx]Sheet1!B4 syntax is not valid in Google Sheets, where data from another spreadsheet is pulled in with IMPORTRANGE. References to another tab in the same file (Sheet2!B4) work in both. Some functions on this page are newer additions to Excel: they are in current Microsoft 365 and Excel for the web, while older perpetual Excel versions return #NAME?. Google Sheets maintains its own function list, so confirm each function exists there before relying on the same formula. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. Treat “excel formula tab name based on cell value” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.

Common mistakes

  • Omitting the cell reference, which produces a name that changes as other sheets recalculate.
  • Testing in an unsaved workbook and concluding the formula is wrong when it is returning "" correctly.
  • Expecting a SHEETNAME function to exist — SHEET() returns the index number, not the name.
  • Putting hundreds of CELL calls on one sheet and adding a volatile recalculation to every keystroke.
  • Hard-coding the sheet name into a title instead, which then silently disagrees with the tab after a rename.

Frequently asked questions

How do I get the sheet name in a formula?

=TEXTAFTER(CELL("filename", A1), "]") on Microsoft 365, or the MID/FIND version in older releases. The workbook must have been saved.

Why does my sheet-name formula return nothing?

The workbook has never been saved, so CELL("filename") has no path to report. Save it once and the formula fills in.

Why does the wrong sheet name appear?

The formula omits the second argument. CELL("filename") alone reports the last-calculated sheet; CELL("filename", A1) reports this one.

How do I get the file name instead of the sheet name?

Take the text between the square brackets: =TEXTBEFORE(TEXTAFTER(CELL("filename",A1),"["),"]").

Other ways people ask this

On the way here you may have searched this as “excel function tab name”, “excel tab name from cell” and “how to create defined names based on values in excel” — it is all the same task, and this page is the single, complete answer to it.

Why do people search for this in so many different ways?

Because the same task has many names. “excel function tab name”, “excel tab name from cell”, “how to create defined names based on values in excel” all point at the one operation explained on this page, which is why they all lead here.