What is the formula for sheet name in Excel?

Now the solution to this problem is to create a formula using multiple functions or to use a custom function created using the VBA.

In this tutorial, you will learn both methods with examples.

Use a Formula to Get the Worksheet Name

To create a formula to get the worksheet name we need to use CELLS, FIND, and MID function. Following is the function where you can get the sheet name.

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

You enter the above formula in any of the cells in the worksheet for which you want to have the sheet name. Now let’s understand this formula, and to understand this we need to break it up into four parts.

In the first part, we have a CELL function that returns the address of the workbook along with the current sheet’s name.

What is the formula for sheet name in Excel?

Let’s go through the above formula.

CELL Function

We can use the CELL Function to return the file path, name, and sheet by inputting “filename”.

=CELL("filename")

What is the formula for sheet name in Excel?

To get the current worksheet’s name, you can use the function with or without the optional reference argument, referring to any cell on the current tab.

=CELL("filename",A1)

What is the formula for sheet name in Excel?

You can also get information about any other worksheet by referring to a cell on that sheet.

=CELL("filename",AnotherSheet!A1)

What is the formula for sheet name in Excel?

FIND Function

As shown above, the CELL Function returns the file path, name, and worksheet. We don’t need the path or workbook name, so we need to isolate the sheet name.

First use the FIND Function to determine the position of the character immediately before the sheet name (which is always “]”).

=FIND("]",B3)

What is the formula for sheet name in Excel?

MID Function

Since we have the last character position before the worksheet name, we can now use the MID Function to extract the characters after that position.  Our sheet name starts at the position found above + 1, but we don’t know how long the sheet name is. However, we do know the maximum length of a worksheet name (31), and we can use that in the MID Function:

How do I get the sheet tab name in Excel?

Go to the cell which you want to reference the current sheet tab name, please enter =TabName() and then press the Enter key. Then the current sheet tab name will be display in the cell.

What is sheet name code in Excel?

A sheet name code is a friendly and meaningful name that you can assign to the sheets in your workbook. This is especially useful if you have more than one worksheet because the names can be different. Creating a sheet name in excel is very important to keep track of your data.