SHEET function: Description, Usage, Syntax, Examples and Explanation
What is SHEET function in Excel?
SHEET function is one of the Information functions in Microsoft Excel that returns the sheet number of the reference sheet.
Syntax of SHEET function
SHEET(value)
The SHEET function syntax has the following arguments.
- Value(Optional): Value is the name of a sheet or a reference for which you want the sheet number. If value is omitted, SHEET returns the number of the sheet that contains the function.
SHEET formula explanation
- SHEET includes all worksheets (visible, hidden, or very hidden) in addition to all other sheet types (macro, chart, or dialog sheets).
- If the value argument is not a valid value, SHEET returns the #REF! error value. For example, =SHEET(Sheet1!#REF) will return the #REF! error value.
- If the value argument is a sheet name that is not valid, SHEET returns the #NA error value. For example =SHEET(“badSheetName”) will return the #NA error value.
- SHEET is not available in the Object Model (OM) because the Object Model already includes similar functionality.
Example of SHEET function
Steps to follow:
1. Open a new Excel worksheet.
2. Copy data in the following table below and paste it in cell A1
Note: For formulas to show results, select them, press F2 key on your keyboard and then press Enter.
You can adjust the column widths to see all the data, if need be.
Formula | Description | Result |
=SHEET(QSalesByRegion) | Returns the sheet number that contains the defined name QSalesByRegion on Sheet2, and has a scope that makes it available to the entire workbook. | 2 |
=SHEET(Table1) | Returns the sheet number that contains the table named Table1 on Sheet2, and has a scope that makes it available to the entire workbook. | 2 |
=SHEET(Hi_Temps) | Returns the #NAME? error value because the defined name Hi_Temps is limited to the worksheet that contains it, Sheet2. | #NAME? |
=SHEET(“Stuff”) | Returns the sheet number of the worksheet named Stuff. | 3 |