Documentation

Offset
in package

Table of Contents

Methods

OFFSET()  : array<string|int, mixed>|string
OFFSET.
adjustEndCellColumnForWidth()  : int
adustEndCellRowForHeight()  : int
assessCellAddress()  : string
extractRequiredCells()  : array<string|int, mixed>
extractWorksheet()  : array<string|int, mixed>

Methods

OFFSET()

OFFSET.

public static OFFSET([null|string $cellAddress = null ][, mixed $rows = 0 ][, mixed $columns = 0 ][, 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 = 0

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

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
Return values
array<string|int, mixed>|string

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

adjustEndCellColumnForWidth()

private static adjustEndCellColumnForWidth(string $endCellColumn, mixed $width, int $startCellColumn, mixed $columns) : int
Parameters
$endCellColumn : string
$width : mixed
$startCellColumn : int
$columns : mixed
Return values
int

adustEndCellRowForHeight()

private static adustEndCellRowForHeight(mixed $height, int $startCellRow, mixed $rows, mixed $endCellRow) : int
Parameters
$height : mixed
$startCellRow : int
$rows : mixed
$endCellRow : mixed
Return values
int

assessCellAddress()

private static assessCellAddress(string $cellAddress, Cell $cell) : string
Parameters
$cellAddress : string
$cell : Cell
Return values
string

extractRequiredCells()

private static extractRequiredCells(Worksheet|null $worksheet, string $cellAddress) : array<string|int, mixed>
Parameters
$worksheet : Worksheet|null
$cellAddress : string
Return values
array<string|int, mixed>

extractWorksheet()

private static extractWorksheet(string|null $cellAddress, Cell $cell) : array<string|int, mixed>
Parameters
$cellAddress : string|null
$cell : Cell
Return values
array<string|int, mixed>

        
On this page

Search results