Wuya Tutorial-JavaScript-OFFSET Function

describe

The OFFSET function returns a reference to a range, which is a cell or a specified number of rows and columns in a range of cells.

The reference returned can be a single cell or a range of cells. You can specify the number of rows and columns to return.

grammar

OFFSET (reference, rows, cols, [height], [width]) 

debate

Argument describe Required/Optional
Reference

The reference you want to base your offset on.

The reference must refer to a cell or a range of adjacent cells.

Otherwise, OFFSET returns the #VALUE! error value.

Required
Rows

The number of rows (top and bottom) you want the top left cell to refer to.

like. Use 5 as the rows parameter to specify that the upper-left cell in the reference is five rows below the reference.

Rows can be positive (meaning below the starting reference) or negative (meaning above the starting reference).

Required
Cols

You want to refer to the number of columns to the left or right of the upper-left cell of the output.

like. Use 5 as the cols argument to specify that the upper left cell in the reference is five columns to the right of the reference.

Cols can be positive (representing the right side of the starting reference) or negative (representing the left side of the starting reference).

Required
Height

The height in rows of the reference you wish to return.

The height must be a positive number.

Optional
Width

The width (in number of columns) of the reference you want returned.

Width must be a positive number.

Optional

Notes

  • If the height or width is omitted, it is assumed to be the same as the reference height or width.

  • OFFSET doesn't actually move any cells or change the selection. It just returns a reference.

  • OFFSET can be used with any function that requires reference parameters. like. The formula SUM(OFFSET(C2,1,2,3,1)) calculates the total value of the 3 rows by 1 column range 1 row below and 2 columns to the right of cell C2.

  • If the row and column offsets exceed the edge of the worksheet, OFFSET returns the #REF! error value.

  • If any argument, row, column, height, or width is not a number, OFFSET returns a #VALUE! error value.

applicability

Excel 2007,Excel 2010,Excel 2013,Excel 2016

Example

OFFSET Function

OFFSET function in JavaScript - Wuya Tutorial Network Wuya Tutorial Network provides a description. The OFFSET function returns a reference to a range, which is a specified number of rows and columns in a cell or range of cells... https:// www .learnfk.com/javascript/advanced-excel-lookup-reference-offset-function.html

Guess you like

Origin blog.csdn.net/w116858389/article/details/132915187