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

Data Analysis

  • Data Series in Excel
  • Remove Duplicates Example in Excel
  • Excel Frequency Function Example
  • How to count table columns in Excel
  • Everything about Charts in Excel

References

  • Count unique text values with criteria
  • How to get relative column numbers in a range in Excel
  • Two-way lookup with VLOOKUP in Excel
  • Perform case-sensitive Lookup in Excel
  • How to get last column number in range in Excel

Data Validations

  • Excel Data validation exists in list
  • Excel Data validation allow weekday only
  • Excel Data validation whole percentage only
  • Excel Data validation allow uppercase only
  • Excel Data validation date in next 30 days

How to check worksheet name exists in Excel

by

To test if a worksheet name exists in a workbook, you can use a formula based on the ISREF and INDIRECT functions.

Formula

=ISREF(INDIRECT("sheetname"&"!A1"))

Explanation

In the example shown, the formula in C5 is:

=ISREF(INDIRECT(B5&"!A1"))

How this formula works

The ISREF function returns TRUE for a valid worksheet reference and FALSE is not.

In this case, we want to find out of a particular sheet exists in a workbook, so we construct a full reference by concatenating the sheet names in column B with an exclamation mark and “A1”:

B5&"!A1"

This returns the text:

"Sheet1!A1"

which goes into the INDIRECT function. INDIRECT then tries to evaluate the text as a reference.

When INDIRECT succeeds, the reference is passed into ISREF which returns TRUE. When INDIRECT can’t create a reference, it throws a #REF error, and ISREF returns FALSE.

Dealing with spaces and punctuation in sheet names

If sheet names contain spaces, or punctuation characters, you’ll need to adjust the formula to wrap the sheet name in single quotes like this:

=ISREF(INDIRECT("'"&sheetname&"'!A1"))

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

  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • IFERROR function: Description, Usage, Syntax, Examples and Explanation
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • SWITCH function example in Excel
  • Check multiple cells are equal in Excel

Date Time

  • How to calculate most recent day of week in Excel
  • Convert Excel time to decimal seconds
  • Get first Monday before any date in Excel
  • Steps to create Dynamic calendar grid in Excel
  • Assign points based on late time in Excel

Grouping

  • Group numbers at uneven intervals in Excel
  • Group times into unequal buckets in Excel
  • Map text to numbers in Excel
  • Map inputs to arbitrary values in Excel
  • How to randomly assign people to groups in Excel

General

  • Count cells that do not contain errors in Excel
  • How to get Excel workbook path only
  • How to count total number of cells in a rectangular range in Excel
  • Using Existing Templates in Excel
  • How to generate random number weighted probability in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning