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

From Apache OpenOffice Wiki

< Documentation | How Tos

OOoWikiBot (Talk | contribs) m (Robot: Automated text replacement %s) |
m |
||

Line 35: | Line 35: | ||

* [[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]]}} | ||

− | [[Category: Documentation/Reference/Calc]] | + | [[Category: Documentation/Reference/Calc/Spreadsheet functions]] |

## Revision as of 11:32, 17 May 2010

## COLUMN

Returns the column number(s), given a reference.

### Syntax:

**COLUMN(reference)**

- returns the column number of
, where**reference**is a reference to a cell.**reference**

- If
is omitted, the column number of the current cell (containing the formula) is returned.**reference**

- If
is a range of cells**reference**__and__the formula is entered as an array formula (by pressing**Ctrl-Shift Enter**rather than**Enter**) a single row array of column numbers is returned.

### Example:

**COLUMN(B3)**

- returns
. Cell B3 is in the second column (column B).**2**

**COLUMN()**

- if entered in cell C7, returns
. Cell C7 is in the third column.**3**

` COLUMN(D2:F3)` (entered with the

**Enter**key)

- returns
. This is**4**__not__an array formula, so the column number of the first cell D2 is returned.

` COLUMN(D2:F3)` (entered with

**Ctrl-Shift-Enter**)

- returns the single row array
, as this**{4; 5; 6}**__is__an array formula. If this formula is entered in cell A1, A1 will display, B1**4**and C1**5**.**6**