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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Automated text replacement %s)
m (Robot: Automated text replacement %s)
Line 27: Line 27:
 
* [[Documentation/How_Tos/Calc: ROWS function|ROWS]]
 
* [[Documentation/How_Tos/Calc: ROWS function|ROWS]]
 
* [[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: 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]]
  
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}

Revision as of 13:56, 26 February 2009


COLUMNS

Returns the number of columns in a given reference.

Syntax:

COLUMNS(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 COLUMNS sums the number of columns in each range, irrespective of any duplication of columns.

Example:

COLUMNS(A3:B5)

returns 2; there are two columns in this range, namely columns A and B.

COLUMNS(G4:H4)

returns 2; there are two columns in this range, namely columns G and H.

COLUMNS(D8)

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

COLUMNS(myref)

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

Template:Documentation/SeeAlso

Personal tools