\PHPExcel_Calculation_LookupRef

PHPExcel_Calculation_LookupRef

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Summary

Methods
Properties
Constants
CELL_ADDRESS()
COLUMN()
COLUMNS()
ROW()
ROWS()
HYPERLINK()
INDIRECT()
OFFSET()
CHOOSE()
MATCH()
INDEX()
TRANSPOSE()
VLOOKUP()
HLOOKUP()
LOOKUP()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
vlookupSort()
No private properties found
N/A

Methods

CELL_ADDRESS()

CELL_ADDRESS(  $row,   $column,   $relativity = 1,   $referenceStyle = true,   $sheetText = '') : string

CELL_ADDRESS

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

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

Parameters

$row
$column
$relativity
$referenceStyle
$sheetText

Returns

string

COLUMN()

COLUMN(  $cellAddress = null) : integer

COLUMN

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 0.

Excel Function: =COLUMN([cellAddress])

Parameters

$cellAddress

Returns

integer —

or array of integer

COLUMNS()

COLUMNS(  $cellAddress = null) : integer

COLUMNS

Returns the number of columns in an array or reference.

Excel Function: =COLUMNS(cellAddress)

Parameters

$cellAddress

Returns

integer —

The number of columns in cellAddress

ROW()

ROW(  $cellAddress = null) : integer

ROW

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 0.

Excel Function: =ROW([cellAddress])

Parameters

$cellAddress

Returns

integer —

or array of integer

ROWS()

ROWS(  $cellAddress = null) : integer

ROWS

Returns the number of rows in an array or reference.

Excel Function: =ROWS(cellAddress)

Parameters

$cellAddress

Returns

integer —

The number of rows in cellAddress

HYPERLINK()

HYPERLINK(string  $linkURL = '', string  $displayName = null, \PHPExcel_Cell  $pCell = null) : mixed

HYPERLINK

Excel Function: =HYPERLINK(linkURL,displayName)

Parameters

string $linkURL

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

string $displayName

Value to return when testValue is an error condition

\PHPExcel_Cell $pCell

The cell to set the hyperlink in

Returns

mixed —

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

INDIRECT()

INDIRECT(\cellAddress  $cellAddress = null, \PHPExcel_Cell  $pCell = null) : mixed

INDIRECT

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

Excel Function: =INDIRECT(cellAddress)

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

Parameters

\cellAddress $cellAddress

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

\PHPExcel_Cell $pCell

The current cell (containing this formula)

Returns

mixed —

The cells referenced by cellAddress

OFFSET()

OFFSET(  $cellAddress = null,   $rows,   $columns,   $height = null,   $width = null) : string

OFFSET

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
$rows
$columns
$height
$width

Returns

string —

A reference to a cell or range of cells

CHOOSE()

CHOOSE() : mixed

CHOOSE

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], ...)

Returns

mixed —

The selected value

MATCH()

MATCH(  $lookup_value,   $lookup_array,   $match_type = 1) : integer

MATCH

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

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

Parameters

$lookup_value
$lookup_array
$match_type

Returns

integer —

The relative position of the found item

INDEX()

INDEX(  $arrayValues,   $rowNum,   $columnNum) : mixed

INDEX

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

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

Parameters

$arrayValues
$rowNum
$columnNum

Returns

mixed —

the value of a specified cell or array of cells

TRANSPOSE()

TRANSPOSE(array  $matrixData) : array

TRANSPOSE

Parameters

array $matrixData

A matrix of values

Returns

array —

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

VLOOKUP()

VLOOKUP(  $lookup_value,   $lookup_array,   $index_number,   $not_exact_match = true) : 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.

Parameters

$lookup_value
$lookup_array
$index_number
$not_exact_match

Returns

mixed —

The value of the found cell

HLOOKUP()

HLOOKUP(  $lookup_value,   $lookup_array,   $index_number,   $not_exact_match = true) : 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.

Parameters

$lookup_value
$lookup_array
$index_number
$not_exact_match

Returns

mixed —

The value of the found cell

LOOKUP()

LOOKUP(  $lookup_value,   $lookup_vector,   $result_vector = null) : mixed

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

Parameters

$lookup_value
$lookup_vector
$result_vector

Returns

mixed —

The value of the found cell

vlookupSort()

vlookupSort(  $a,   $b) 

Parameters

$a
$b