Excel Extract Worksheet Name by formula

Last Updated on 05/04/2025
Reading time: 2 minutes

Extract the worksheet name with a formula it's possible in Excel.

  1. Use the CELL function to return the full path, including the worksheet name.
  2. Then, use the TEXTAFTER function to extract only the worksheet name.
  3. If you don't have Excel 365, there is another technique to extract the filename from the string.

The CELL function

The CELL function automatically returns file properties, such as the full path, worksheet name, and cell address. This function helps you get dynamic information about a cell or the workbook.

The CELL function is different from the INFO function. The INFO function returns details about the system, such as the Excel version or memory availability.

  • To extract the worksheet name, use the "filename" option in the CELL function.
  • ⚠️ Make sure the file is saved. If not, the CELL function returns nothing.

When saved, the function returns this information in the following order:

  1. Path of the file, here C:\Log\
  2. File name between brackets [Extract Worksheet name.xlsx]
  3. Worksheet name Tuesday
CELL function extracts the filename

How to extract the worksheet name?

Next, you will isolate the worksheet name from the previous string. We must extract the substring after the ] character.

The TEXTAFTER function

The TEXTAFTER function is available exclusively in Excel 365 and Excel Online. It’s easy to use—just specify the character that comes before the substring you want to extract. Here’s the full formula:

Extract of the worksheet name with TEXTAFTER function

For all the other Excel versions

If you're not using Excel 365, there's still a way to extract the text after the ' ] '. This alternative method uses a combination of functions:

  • LEN to get the total length of the string
  • SEARCH to locate the position of the ' ] '
  • And finally, the RIGHT function to extract the desired substring
Extract worksheet name with the RIGTH LEN SEARCH functions

Both methods help you extract the worksheet name dynamically with a formula.

Related articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Excel Extract Worksheet Name by formula

Reading time: 2 minutes
Last Updated on 05/04/2025

Extract the worksheet name with a formula it's possible in Excel.

  1. Use the CELL function to return the full path, including the worksheet name.
  2. Then, use the TEXTAFTER function to extract only the worksheet name.
  3. If you don't have Excel 365, there is another technique to extract the filename from the string.

The CELL function

The CELL function automatically returns file properties, such as the full path, worksheet name, and cell address. This function helps you get dynamic information about a cell or the workbook.

The CELL function is different from the INFO function. The INFO function returns details about the system, such as the Excel version or memory availability.

  • To extract the worksheet name, use the "filename" option in the CELL function.
  • ⚠️ Make sure the file is saved. If not, the CELL function returns nothing.

When saved, the function returns this information in the following order:

  1. Path of the file, here C:\Log\
  2. File name between brackets [Extract Worksheet name.xlsx]
  3. Worksheet name Tuesday
CELL function extracts the filename

How to extract the worksheet name?

Next, you will isolate the worksheet name from the previous string. We must extract the substring after the ] character.

The TEXTAFTER function

The TEXTAFTER function is available exclusively in Excel 365 and Excel Online. It’s easy to use—just specify the character that comes before the substring you want to extract. Here’s the full formula:

Extract of the worksheet name with TEXTAFTER function

For all the other Excel versions

If you're not using Excel 365, there's still a way to extract the text after the ' ] '. This alternative method uses a combination of functions:

  • LEN to get the total length of the string
  • SEARCH to locate the position of the ' ] '
  • And finally, the RIGHT function to extract the desired substring
Extract worksheet name with the RIGTH LEN SEARCH functions

Both methods help you extract the worksheet name dynamically with a formula.

Related articles

Leave a Reply

Your email address will not be published. Required fields are marked *