Purpose
Return value
Syntax
=SHEETS([reference])
- reference - [optional] A valid Excel reference.
Using the SHEETS function
The SHEETS function returns the total number of sheets in a given reference. SHEETS takes one argument, reference , which should be a cell reference, or a 3D reference . When no references are supplied SHEETS returns the total number of sheets in the workbook. The SHEETS function includes hidden sheets.
Examples
For example, in a workbook that contains 5 sheets, the following formula will return 5:
=SHEETS()
SHEETS can be used to report the sheet count in 3D references as well. For example, in a workbook with three sheets (Sheet1 through Sheet3) in numeric order, the formulas below return results as shown:
=SHEETS(Sheet1:Sheet1!A1) // returns 1
=SHEETS(Sheet1:Sheet2!A1) // returns 2
=SHEETS(Sheet1:Sheet3!A1) // returns 3
Notes
- If the reference is omitted, SHEETS returns the total sheets in a workbook.
- SHEETS includes hidden sheets in the count.
- SHEETS will report sheet count in 3D references.
- The SHEET function returns the index of a sheet. SHEETS returns a count.
Purpose
Return value
Syntax
=T(value)
- value - The value to return as text.
Using the T function
The Excel T function converts numbers, dates, and the logical values TRUE and FALSE into empty strings . Text values and errors are not converted and pass through unaffected. You can use the T function to remove values that are not text.
The T function takes one argument, value , which can be a cell reference, a formula result, or a hardcoded value.
Examples
The T function returns text when given a text value and an empty string ("") for numbers, dates, and the logical values TRUE and FALSE. For example:
=T("apple") // returns "apple"
=T("NASA") // returns "NASA"
=T(100) // returns ""
=T(FALSE) // returns ""
In most cases, the T function is unnecessary, because Excel automatically converts values when needed. The T function is provided for compatibility with other spreadsheet programs.
Errors are not affected by the T function:
=T(3/0) // returns #DIV/0!
=T("#N/A") // returns #N/A
Notes
- The T function removes numeric values. The N function removes text values.