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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Syntax:)
(included 'use with multiple ranges')
Line 2: Line 2:
  
 
== ROWS  ==
 
== ROWS  ==
Returns the number of rows in a given range.
+
Returns the number of rows in a given reference.
  
 
=== Syntax: ===
 
=== Syntax: ===
<tt>'''ROWS(range)'''</tt>
+
<tt>'''ROWS(reference)'''</tt>
  
: <tt>'''range'''</tt> is a range of cells, given either explicitly (<tt>'''A3:B5'''</tt>) or by name (<tt>'''myrangename'''</tt>) if a range name has been defined.
+
: <tt>'''reference'''</tt> may be given either explicitly (eg <tt>'''A3:B5'''</tt>) or by name (eg <tt>'''myref'''</tt>).
 +
 
 +
: It is possible to define a name to represent more than one range (eg by entering <tt>'''$A$1:$A$3;$C$1:$C$4'''</tt> in the '''Assigned To''' box of the '''Insert - Names - Define...''' dialog). In this case <tt>'''ROWS'''</tt> sums the number of rows in each range, irrespective of any duplication of rows.  
  
 
=== Example: ===
 
=== Example: ===
Line 18: Line 20:
 
<tt>'''ROWS(D8)'''</tt>
 
<tt>'''ROWS(D8)'''</tt>
 
: returns <tt>'''1'''</tt>; <tt>'''D8'''</tt> is interpreted as a one cell range, with a single row (row 8).
 
: returns <tt>'''1'''</tt>; <tt>'''D8'''</tt> is interpreted as a one cell range, with a single row (row 8).
 +
 +
<tt>'''ROWS(myref)'''</tt>
 +
: where <tt>'''myref'''</tt> has been defined as the multiple range <tt>'''$A$1:$A$3;$C$1:$C$4'''</tt>, returns <tt>'''7'''</tt>;
  
 
=== See also: ===
 
=== See also: ===
 
'''[[Documentation/How_Tos/Calc: COLUMNS function|COLUMNS]]''',
 
'''[[Documentation/How_Tos/Calc: COLUMNS function|COLUMNS]]''',
'''[[Documentation/How_Tos/Calc: SHEETS function|SHEETS]]'''
+
'''[[Documentation/How_Tos/Calc: SHEETS function|SHEETS]]''',
 +
'''[[Documentation/How_Tos/Calc: AREAS function|AREAS]]'''
  
 
'''[[Documentation/How_Tos/Calc: Information functions|Information functions]]''',
 
'''[[Documentation/How_Tos/Calc: Information functions|Information functions]]''',
 
'''[[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]]'''
 
'''[[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]]'''

Revision as of 19:07, 19 February 2008


ROWS

Returns the number of rows in a given reference.

Syntax:

ROWS(reference)

reference may be given either explicitly (eg A3:B5) or by name (eg myref).
It is possible to define a name to represent more than one range (eg by entering $A$1:$A$3;$C$1:$C$4 in the Assigned To box of the Insert - Names - Define... dialog). In this case ROWS sums the number of rows in each range, irrespective of any duplication of rows.

Example:

ROWS(A3:B5)

returns 3; there are three rows in this range, namely rows 3,4 and 5.

ROWS(G4:G6)

returns 3; there are three rows in this range, namely rows 4,5 and 6.

ROWS(D8)

returns 1; D8 is interpreted as a one cell range, with a single row (row 8).

ROWS(myref)

where myref has been defined as the multiple range $A$1:$A$3;$C$1:$C$4, returns 7;

See also:

COLUMNS, SHEETS, AREAS

Information functions, Spreadsheet functions

Personal tools