Documentation

LookupRef

Tags
deprecated
1.18.0

Table of Contents

cellAddress()  : array<string|int, mixed>|string
CELL_ADDRESS.
CHOOSE()  : mixed
CHOOSE.
COLUMN()  : int|array<string|int, int>|string
COLUMN.
COLUMNS()  : int|string
COLUMNS.
FORMULATEXT()  : string
FORMULATEXT.
HLOOKUP()  : mixed
HLOOKUP The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.
HYPERLINK()  : string
HYPERLINK.
INDEX()  : mixed
INDEX.
INDIRECT()  : array<string|int, mixed>|string
INDIRECT.
LOOKUP()  : mixed
LOOKUP The LOOKUP function searches for value either from a one-row or one-column range or from an array.
MATCH()  : array<string|int, mixed>|int|string
MATCH.
OFFSET()  : array<string|int, mixed>|string
OFFSET.
ROW()  : int|array<string|int, mixed>|string
ROW.
ROWS()  : int|string
ROWS.
TRANSPOSE()  : array<string|int, mixed>
TRANSPOSE.
VLOOKUP()  : mixed
VLOOKUP The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.

Methods

cellAddress()

CELL_ADDRESS.

public static cellAddress(mixed $row, mixed $column[, int $relativity = 1 ][, bool $referenceStyle = true ][, array<string|int, mixed>|string $sheetText = '' ]) : array<string|int, mixed>|string

Creates a cell address as text, given specified row and column numbers.

Excel Function: =ADDRESS(row, column, [relativity], [referenceStyle], [sheetText])

Parameters
$row : mixed

Row number to use in the cell reference

$column : mixed

Column number to use in the cell reference

$relativity : int = 1

Flag indicating the type of reference to return 1 or omitted Absolute 2 Absolute row; relative column 3 Relative row; absolute column 4 Relative

$referenceStyle : bool = true

A logical value that specifies the A1 or R1C1 reference style. TRUE or omitted CELL_ADDRESS returns an A1-style reference FALSE CELL_ADDRESS returns an R1C1-style reference

$sheetText : array<string|int, mixed>|string = ''

Optional Name of worksheet to use

Tags
Deprecated

1.18.0

see
Address::cell()

Use the cell() method in the LookupRef\Address class instead

Return values
array<string|int, mixed>|string

CHOOSE()

CHOOSE.

public static CHOOSE(mixed ...$chooseArgs) : mixed

Uses lookup_value to return a value from the list of value arguments. Use CHOOSE to select one of up to 254 values based on the lookup_value.

Excel Function: =CHOOSE(index_num, value1, [value2], ...)

Parameters
$chooseArgs : mixed
Tags
Deprecated

1.18.0

see
Selection::choose()

Use the choose() method in the LookupRef\Selection class instead

Return values
mixed

The selected value

COLUMN()

COLUMN.

public static COLUMN([null|array<string|int, mixed>|string $cellAddress = null ][, Cell|null $cell = null ]) : int|array<string|int, int>|string

Returns the column number of the given cell reference If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array. If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the reference of the cell in which the COLUMN function appears; otherwise this function returns 1.

Excel Function: =COLUMN([cellAddress])

Parameters
$cellAddress : null|array<string|int, mixed>|string = null

A reference to a range of cells for which you want the column numbers

$cell : Cell|null = null
Tags
Deprecated

1.18.0

see
RowColumnInformation::COLUMN()

Use the COLUMN() method in the LookupRef\RowColumnInformation class instead

Return values
int|array<string|int, int>|string

COLUMNS()

COLUMNS.

public static COLUMNS([null|array<string|int, mixed>|string $cellAddress = null ]) : int|string

Returns the number of columns in an array or reference.

Excel Function: =COLUMNS(cellAddress)

Parameters
$cellAddress : null|array<string|int, mixed>|string = null

An array or array formula, or a reference to a range of cells for which you want the number of columns

Tags
Deprecated

1.18.0

see
RowColumnInformation::COLUMNS()

Use the COLUMNS() method in the LookupRef\RowColumnInformation class instead

Return values
int|string

The number of columns in cellAddress, or a string if arguments are invalid

FORMULATEXT()

FORMULATEXT.

public static FORMULATEXT([mixed $cellReference = '' ][, Cell $cell = null ]) : string
Parameters
$cellReference : mixed = ''

The cell to check

$cell : Cell = null

The current cell (containing this formula)

Tags
Deprecated

1.18.0

see
Formula::text()

Use the text() method in the LookupRef\Formula class instead

Return values
string

HLOOKUP()

HLOOKUP The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.

public static HLOOKUP(mixed $lookup_value, mixed $lookup_array, mixed $index_number[, mixed $not_exact_match = true ]) : mixed
Parameters
$lookup_value : mixed

The value that you want to match in lookup_array

$lookup_array : mixed

The range of cells being searched

$index_number : mixed

The row number in table_array from which the matching value must be returned. The first row is 1.

$not_exact_match : mixed = true

determines if you are looking for an exact match based on lookup_value

Tags
Deprecated

1.18.0

see
HLookup::lookup()

Use the lookup() method in the LookupRef\HLookup class instead

Return values
mixed

The value of the found cell

HYPERLINK.

public static HYPERLINK([mixed $linkURL = '' ][, mixed $displayName = null ][, Cell $cell = null ]) : string

Excel Function: =HYPERLINK(linkURL,displayName)

Parameters
$linkURL : mixed = ''

Expect string. Value to check, is also the value returned when no error

$displayName : mixed = null

Expect string. Value to return when testValue is an error condition

$cell : Cell = null

The cell to set the hyperlink in

Tags
Deprecated

1.18.0

see
Hyperlink::set()

Use the set() method in the LookupRef\Hyperlink class instead

Return values
string

The value of $displayName (or $linkURL if $displayName was blank)

INDEX()

INDEX.

public static INDEX(mixed $matrix, mixed $rowNum, mixed $columnNum) : mixed

Uses an index to choose a value from a reference or array

Excel Function: =INDEX(range_array, row_num, [column_num])

Parameters
$matrix : mixed
$rowNum : mixed

The row in the array or range from which to return a value. If row_num is omitted, column_num is required.

$columnNum : mixed

The column in the array or range from which to return a value. If column_num is omitted, row_num is required.

Tags
Deprecated

1.18.0

see
Matrix::index()

Use the index() method in the LookupRef\Matrix class instead

Return values
mixed

the value of a specified cell or array of cells

INDIRECT()

INDIRECT.

public static INDIRECT(array<string|int, mixed>|string $cellAddress, Cell $cell) : array<string|int, mixed>|string

Returns the reference specified by a text string. References are immediately evaluated to display their contents.

Excel Function: =INDIRECT(cellAddress)

Parameters
$cellAddress : array<string|int, mixed>|string

$cellAddress The cell address of the current cell (containing this formula)

$cell : Cell

The current cell (containing this formula)

Tags
Deprecated

1.18.0

see
Indirect::INDIRECT()

Use the INDIRECT() method in the LookupRef\Indirect class instead

NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010

Return values
array<string|int, mixed>|string

An array containing a cell or range of cells, or a string on error

LOOKUP()

LOOKUP The LOOKUP function searches for value either from a one-row or one-column range or from an array.

public static LOOKUP(mixed $lookup_value, mixed $lookup_vector[, null|mixed $result_vector = null ]) : mixed
Parameters
$lookup_value : mixed

The value that you want to match in lookup_array

$lookup_vector : mixed

The range of cells being searched

$result_vector : null|mixed = null

The column from which the matching value must be returned

Tags
Deprecated

1.18.0

see
Lookup::lookup()

Use the lookup() method in the LookupRef\Lookup class instead

Return values
mixed

The value of the found cell

MATCH()

MATCH.

public static MATCH(mixed $lookupValue, mixed $lookupArray[, mixed $matchType = 1 ]) : array<string|int, mixed>|int|string

The MATCH function searches for a specified item in a range of cells

Excel Function: =MATCH(lookup_value, lookup_array, [match_type])

Parameters
$lookupValue : mixed

The value that you want to match in lookup_array

$lookupArray : mixed

The range of cells being searched

$matchType : mixed = 1

The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered.

Tags
Deprecated

1.18.0

see
ExcelMatch::MATCH()

Use the MATCH() method in the LookupRef\ExcelMatch class instead

Return values
array<string|int, mixed>|int|string

The relative position of the found item

OFFSET()

OFFSET.

public static OFFSET([null|string $cellAddress = null ], mixed $rows, mixed $columns[, mixed $height = null ][, mixed $width = null ][, Cell|null $cell = null ]) : array<string|int, mixed>|string

Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells. The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and the number of columns to be returned.

Excel Function: =OFFSET(cellAddress, rows, cols, [height], [width])

Parameters
$cellAddress : null|string = null

The reference from which you want to base the offset. Reference must refer to a cell or range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.

$rows : mixed

The number of rows, up or down, that you want the upper-left cell to refer to. Using 5 as the rows argument specifies that the upper-left cell in the reference is five rows below reference. Rows can be positive (which means below the starting reference) or negative (which means above the starting reference).

$columns : mixed

The number of columns, to the left or right, that you want the upper-left cell of the result to refer to. Using 5 as the cols argument specifies that the upper-left cell in the reference is five columns to the right of reference. Cols can be positive (which means to the right of the starting reference) or negative (which means to the left of the starting reference).

$height : mixed = null

The height, in number of rows, that you want the returned reference to be. Height must be a positive number.

$width : mixed = null

The width, in number of columns, that you want the returned reference to be. Width must be a positive number.

$cell : Cell|null = null
Tags
Deprecated

1.18.0

see
Offset::OFFSET()

Use the OFFSET() method in the LookupRef\Offset class instead

Return values
array<string|int, mixed>|string

An array containing a cell or range of cells, or a string on error

ROW()

ROW.

public static ROW([null|array<string|int, mixed>|string $cellAddress = null ][, Cell|null $cell = null ]) : int|array<string|int, mixed>|string

Returns the row number of the given cell reference If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array. If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the reference of the cell in which the ROW function appears; otherwise this function returns 1.

Excel Function: =ROW([cellAddress])

Parameters
$cellAddress : null|array<string|int, mixed>|string = null

A reference to a range of cells for which you want the row numbers

$cell : Cell|null = null
Tags
Deprecated

1.18.0

see
RowColumnInformation::ROW()

Use the ROW() method in the LookupRef\RowColumnInformation class instead

Return values
int|array<string|int, mixed>|string

ROWS()

ROWS.

public static ROWS([null|array<string|int, mixed>|string $cellAddress = null ]) : int|string

Returns the number of rows in an array or reference.

Excel Function: =ROWS(cellAddress)

Parameters
$cellAddress : null|array<string|int, mixed>|string = null

An array or array formula, or a reference to a range of cells for which you want the number of rows

Tags
Deprecated

1.18.0

see
RowColumnInformation::ROWS()

Use the ROWS() method in the LookupRef\RowColumnInformation class instead

Return values
int|string

The number of rows in cellAddress, or a string if arguments are invalid

TRANSPOSE()

TRANSPOSE.

public static TRANSPOSE(array<string|int, mixed> $matrixData) : array<string|int, mixed>
Parameters
$matrixData : array<string|int, mixed>

A matrix of values

Tags
Deprecated

1.18.0

see
Matrix::transpose()

Use the transpose() method in the LookupRef\Matrix class instead

Return values
array<string|int, mixed>

Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix

VLOOKUP()

VLOOKUP The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.

public static VLOOKUP(mixed $lookup_value, mixed $lookup_array, mixed $index_number[, mixed $not_exact_match = true ]) : mixed
Parameters
$lookup_value : mixed

The value that you want to match in lookup_array

$lookup_array : mixed

The range of cells being searched

$index_number : mixed

The column number in table_array from which the matching value must be returned. The first column is 1.

$not_exact_match : mixed = true

determines if you are looking for an exact match based on lookup_value

Tags
Deprecated

1.18.0

see
VLookup::lookup()

Use the lookup() method in the LookupRef\VLookup class instead

Return values
mixed

The value of the found cell

Search results