Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • What-If Analysis: Scenarios and Goal Seek in Excel
  • How to conditionally sum numeric data in an Excel table using SUMIFS
  • Excel Line Chart
  • Get column index in Excel Table
  • How To Sort One Column or Multiple Columns in Excel

References

  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • How to get last row in mixed data with blanks in Excel
  • How to use Excel MMULT Function
  • How to use Excel ROW Function
  • Count rows with at least n matching values

Data Validations

  • Excel Data validation allow weekday only
  • Excel Data validation whole percentage only
  • Excel Data validation no punctuation
  • Excel Data validation number multiple 100
  • Excel Data validation must not contain

How to get sheet name only in Excel

by

If you want to get the sheet name only (i.e. the sheet name without the file name or path) you can do so with rather long formula that uses the MID function along with the FIND function. The final result will look something like this:

Sheet1

Formula

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

Explanation

How the formula works

The cell function is used to get the full file name and path:

CELL("filename",A1)

The result looks like this:

path[workbook.xlsm]sheetname

The full file name plus path and sheet is fed into the MID function, which is used to extract just the sheet name.

Worked Example:   List worksheet index numbers in Excel

The starting position is calculated with FIND:

FIND("]",CELL("filename",A1))+1

The number of characters to extract is supplied as 255. In the Excel UI, you can’t name a worksheet longer than 31 characters, but the file format itself permits worksheet names up to 255 characters.

Worked Example:   How to translate letters to numbers in Excel

Alternative with RIGHT

Several readers have mentioned an alternative like this with the RIGHT function:

=RIGHT(CELL("filename",A1),LEN(CELL
("filename",A1))-FIND("]",CELL
("filename",A1)))

A few more function calls, but a perfectly valid formula.

Post navigation

Previous Post:

How to count line breaks in cell in Excel worksheet

Next Post:

How to count total words in a cell in Excel

Leave a Reply Cancel reply

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

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • IFS function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • Check multiple cells are equal in Excel

Date Time

  • How to calculate Day of the Year in Excel
  • Convert date to text in Excel
  • WORKDAY function: Description, Usage, Syntax, Examples and Explanation
  • How to show last updated date stamp in Excel
  • Calculate series of dates by workdays in Excel

Grouping

  • Group arbitrary text values in Excel
  • Running count group by n size in Excel
  • Group times into 3 hour buckets in Excel
  • Categorize text with keywords in Excel
  • How to randomly assign data to groups in Excel

General

  • How to calculate percentage of total in Excel
  • Advanced Number Formats in Excel
  • With vs Without Array Formula in Excel
  • How to generate random times at specific intervals in Excel
  • How to Delete Cells, Row and Rows in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning