OFFSET returns an area reference that is a specified number of rows and columns from a reference cell or area.
Syntax:
OFFSET(reference, rows, cols, height, width)
reference is the base reference.
rows is the number of rows up or down from the base reference.
cols is the number of columns left or right from the base reference.
height (default same height as base reference) is the row count for the returned area reference.
width (default same width as base reference) is the column count for the returned area reference.
| Modifier and Type | Class and Description |
|---|---|
| private static class | Offset.
Encapsulates either an area or cell reference which may be 2d or 3d. |
| pack-priv static class | Offset.
A one dimensional base + offset. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static AreaEval | createOffset(Offset.
|
| public ValueEval | evaluate(ValueEval[]
the evaluated function arguments. Empty values are represented with
args, int BlankEval or MissingArgEval, never null.row index of the cell containing the formula under evaluation srcCellRow, int column index of the cell containing the formula under evaluation srcCellCol)Implements org.
|
| private static Offset. | |
| pack-priv static int | evaluateIntArg(ValueEval eval, int srcCellRow, int srcCellCol)
OFFSET's numeric arguments (2..5) have similar processing rules |
| Offset | back to summary |
|---|---|
| public Offset() | |
| createOffset | back to summary |
|---|---|
| private static AreaEval createOffset(Offset. | |
| evaluate | back to summary |
|---|---|
| public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) Implements org.
| |
| evaluateBaseRef | back to summary |
|---|---|
| private static Offset. | |
| evaluateIntArg | back to summary |
|---|---|
| pack-priv static int evaluateIntArg(ValueEval eval, int srcCellRow, int srcCellCol) throws EvaluationException OFFSET's numeric arguments (2..5) have similar processing rules | |
| Modifier and Type | Field and Description |
|---|---|
| private final AreaEval | |
| private final int | |
| private final int | |
| private final int | |
| private final RefEval | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | |
| public int | |
| public int | |
| public AreaEval |
| _areaEval | back to summary |
|---|---|
| private final AreaEval _areaEval | |
| _firstColumnIndex | back to summary |
|---|---|
| private final int _firstColumnIndex | |
| _firstRowIndex | back to summary |
|---|---|
| private final int _firstRowIndex | |
| _height | back to summary |
|---|---|
| private final int _height | |
| _refEval | back to summary |
|---|---|
| private final RefEval _refEval | |
| _width | back to summary |
|---|---|
| private final int _width | |
| BaseRef | back to summary |
|---|---|
| public BaseRef(RefEval re) | |
| BaseRef | back to summary |
|---|---|
| public BaseRef(AreaEval ae) | |
| getFirstColumnIndex | back to summary |
|---|---|
| public int getFirstColumnIndex() | |
| getFirstRowIndex | back to summary |
|---|---|
| public int getFirstRowIndex() | |
| getHeight | back to summary |
|---|---|
| public int getHeight() | |
| getWidth | back to summary |
|---|---|
| public int getWidth() | |
| offset | back to summary |
|---|---|
| public AreaEval offset(int relFirstRowIx, int relLastRowIx, int relFirstColIx, int relLastColIx) | |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public short | |
| public short | |
| public boolean | |
| public Offset. | Returns: the equivalentLinearOffsetRange with a positive length, moved by the
specified translationAmount.may be zero negative or positive translationAmount)Moves the range by the specified translation amount. |
| public String |
| _length | back to summary |
|---|---|
| private final int _length | |
| _offset | back to summary |
|---|---|
| private final int _offset | |
| LinearOffsetRange | back to summary |
|---|---|
| public LinearOffsetRange(int offset, int length) | |
| getFirstIndex | back to summary |
|---|---|
| public short getFirstIndex() | |
| getLastIndex | back to summary |
|---|---|
| public short getLastIndex() | |
| isOutOfBounds | back to summary |
|---|---|
| public boolean isOutOfBounds(int lowValidIx, int highValidIx) | |
| normaliseAndTranslate | back to summary |
|---|---|
| public Offset. Moves the range by the specified translation amount. This method also 'normalises' the range: Excel specifies that the width and height parameters (length field here) cannot be negative. However, OFFSET() does produce sensible results in these cases. That behavior is replicated here.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |