Difference between revisions of "Documentation/How Tos/Calc: SHEETS function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (See also:)
(included 'use of multiple ranges')
Line 2: Line 2:
  
 
== SHEETS ==
 
== SHEETS ==
Returns the number of sheets in a given range.
+
Returns the number of sheets in a given reference.
  
 
=== Syntax: ===
 
=== Syntax: ===
<tt>'''SHEETS(range)'''</tt>
+
<tt>'''SHEETS(reference)'''</tt>
  
: <tt>'''range'''</tt> is a range of cells, given either explicitly (<tt>'''Sheet1.A1:Sheet3.G12'''</tt>) or by name (<tt>'''myrangename'''</tt>) if a range name has been defined.
+
: <tt>'''reference'''</tt> may be given either explicitly (<tt>'''Sheet1.A1:Sheet3.G12'''</tt>) or by name (<tt>'''myref'''</tt>).
 +
 
 +
: If the named reference contains multiple ranges, the sum of the sheets in each range is returned, irrespective of any duplication.
  
 
=== Example: ===
 
=== Example: ===

Revision as of 19:25, 19 February 2008


SHEETS

Returns the number of sheets in a given reference.

Syntax:

SHEETS(reference)

reference may be given either explicitly (Sheet1.A1:Sheet3.G12) or by name (myref).
If the named reference contains multiple ranges, the sum of the sheets in each range is returned, irrespective of any duplication.

Example:

SHEETS(Sheet1.A1:Sheet3.G12)

returns 3, if Sheet3 follows Sheet2 which follows Sheet1; there are thus three sheets in this range.

SHEETS(G4:H6)

returns 1; G4:H6 is interpreted as a range on a single sheet (the current sheet).

SHEETS(D8)

returns 1; D8 is interpreted as a one cell range, on a single sheet (the current sheet).

See also:

ROWS, COLUMNS, AREAS

Information functions, Spreadsheet functions

Personal tools