Documentation/How Tos/Calc: INDIRECT function

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 20:29, 15 September 2008 by Drking (Talk | contribs)

Jump to: navigation, search


INDIRECT

Returns a reference, given a text string.

Syntax:

INDIRECT(textref)

textref is a text string specifying the reference to be returned; the reference may be to a single cell or to a range.
The reference may then be used in formulae or functions requiring a reference - see the examples below.

Example:

=INDIRECT("B2")

(in a cell) returns the contents of cell B2. INDIRECT("B2") returns a reference to cell B2, so this is the same as =B2.

=INDIRECT("B" & "2")

also returns the contents of cell B2. "B" & "2" becomes the text string "B2".

=SUM(INDIRECT("A1:C3"))

returns the sum of the numbers in A1:C3.

See also:

ADDRESS

Spreadsheet functions

Functions listed alphabetically, Functions listed by category

Issues:

  • Excel represents some cell references differently to Calc, so this function is not always portable. For example INDIRECT("Sheet2.A1") is valid in Calc, but in Excel the required form is INDIRECT("Sheet2!A1"). A portable solution might be INDIRECT(ADDRESS(1;1;4;"Sheet2")).
  • Excel's version of this function optionally allows an R1C1-style reference.
  • Named cells/ranges are recognised in Calc from OOo2.4 (see Issue 4695).
Personal tools