Go Back

How to Check If Worksheet Name Exists in a Workbook

In order to check whether a certain worksheet name exists in a workbook or not, we can perform this check with the help of the Excel ISREFand INDIRECT functions. This article demonstrates how to perform this.

Figure 1. Checking Worksheet Name in a Workbook

Formula Syntax

The generic formula syntax to check the worksheet name in a workbook is;

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

The Excel ISREF function checks whether a value is a reference and returns TRUE or FALSE and the INDIRECT function returns the reference specified by a text string. In this formula, we can supply the worksheet name as a text value or cell reference and create a full reference of the worksheet name we combine it with an exclamation mark and a general cell reference, such as “!A1”, using the Ampersand symbol (&).

Figure 2. The Syntax of the Formula

Worksheet Name Without Spaces Or Punctuation

The above generic syntax of the formula checks the status of a worksheet name that is without spaces or punctuation in a workbook, like “Mar” or “Payables” etc. Suppose we have different worksheet names in column B that do not contain any space or punctuation and want to check if a worksheet name exists in a workbook. In this case, we will use the following formula in cell C2, such as;

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

Copy down this formula to return the results for all the listed names of worksheets.

Figure 3. Checking the Worksheet Name Without Spaces Or Punctuation

Worksheet Name With Spaces Or Punctuation

If a worksheet name contains spaces or punctuation, like “Income Statement” and “Balance-Sheet” etc, then we need to amend the generic syntax of formula a little bit. To handle this, we will wrap the worksheet name in the single quotation mark as per the following formula syntax in cell C8 or C9;

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

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

Figure 4. Checking the Worksheet Name With Spaces Or Punctuation

Instant Connection to an Expert through our Excelchat Service:

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

WHEN USING MOVE OR COPY FUNCTION FOR CREATING A COPY OF A PAGE I GET A MESSAGE "A FORMULA OR SHEET YOU WANT TO MOVE OR COPY CONTAINS THE NAME '_BU65999' WHICH ALREADY EXISTS ON THE DESTINATION WORKSHEET.
Solved by F. H. in 22 mins
Hello, I have a list of values from highest to lowest with different names next to the values. When i do a vlookup of duplicate values i get the same name. Is it possible to lookup duplicate values and if a name already exists in the worksheet it goes to the next name in the report?
Solved by G. H. in 27 mins
I have just switched computers, last week if I moved a worksheet from one book to another, i was prompted with the below question, I no longer see that question, excel just copies the name again, how do i get the prompt back? A formula or sheet you want to move or copy contains the name "MY_MENU", which already exists on the destination worksheet. Do you want to use this version of the name? * To use the name as defined in the destination sheet, click Yes. * To rename the range referred to in the formula or worksheet, click No, and enter a new name in the Name Conflict dialog box
Solved by T. H. in 14 mins

Leave a Comment

avatar