Difference between revisions of "Documentation/How Tos/Calc: OFFSET function"
From Apache OpenOffice Wiki
< Documentation | How Tos
(→Issues:: issue 86658) |
m |
||
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | __NOTOC__ | + | {{DISPLAYTITLE:OFFSET function}} |
+ | {{Documentation/CalcFunc SpreadsheetTOC | ||
+ | |ShowPrevNext=block | ||
+ | |PrevPage=Documentation/How_Tos/Calc:_MATH_function | ||
+ | |NextPage=Documentation/How_Tos/Calc:_VLOOKUP_function | ||
+ | }}__NOTOC__ | ||
== OFFSET == | == OFFSET == | ||
Line 21: | Line 26: | ||
<tt>'''=SUM(OFFSET(A1; 2; 2; 2; 3))'''</tt> | <tt>'''=SUM(OFFSET(A1; 2; 2; 2; 3))'''</tt> | ||
− | : in a cell, returns the sum of the contents of cells C3:E4. 2 rows and 2 columns are added to A1 to offset it to C3, and then the new size extends the range to E4. | + | : in a cell, returns the sum of the contents of cells C3:E4. 2 rows and 2 columns are added to A1, to offset it to C3, and then the new size extends the range to E4. |
<tt>'''=SUM(OFFSET(C1:G1; 0; 0; 1; 3))'''</tt> | <tt>'''=SUM(OFFSET(C1:G1; 0; 0; 1; 3))'''</tt> | ||
: in a cell, returns the sum of the contents of cells C1:E1. | : in a cell, returns the sum of the contents of cells C1:E1. | ||
− | === | + | === Issues: === |
− | ''' | + | *The <tt>'''new_height'''</tt> parameter cannot be empty. {{bug|3879}} addresses this. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | {{SeeAlso|EN| | |
− | + | * [[Documentation/How_Tos/Calc: CHOOSE function|CHOOSE]] | |
− | + | * [[Documentation/How_Tos/Calc: HLOOKUP function|HLOOKUP]] | |
− | + | * [[Documentation/How_Tos/Calc: INDEX function|INDEX]] | |
+ | * [[Documentation/How_Tos/Calc: LOOKUP function|LOOKUP]] | ||
+ | * [[Documentation/How_Tos/Calc: MATCH function|MATCH]] | ||
+ | * [[Documentation/How_Tos/Calc: VLOOKUP function|VLOOKUP]] | ||
− | + | * [[Documentation/How_Tos/Calc: ROW function|ROW]] | |
+ | * [[Documentation/How_Tos/Calc: ROWS function|ROWS]] | ||
+ | * [[Documentation/How_Tos/Calc: COLUMN function|COLUMN]] | ||
+ | * [[Documentation/How_Tos/Calc: COLUMNS function|COLUMNS]] | ||
− | + | * [[Documentation/How_Tos/Calc: SUM function|SUM]] | |
− | + | * [[Documentation/How_Tos/Calc: Spreadsheet functions|Spreadsheet functions]] | |
− | * | + | |
− | * | + | * [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]] |
+ | * [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}} | ||
+ | [[Category: Documentation/Reference/Calc/Spreadsheet functions]] |
Latest revision as of 11:18, 2 February 2024
- Spreadsheet FunctionsSpreadsheet Lookup functions
- ADDRESSCHOOSEHLOOKUPINDEXINDIRECTLOOKUPMATHOFFSETVLOOKUPSpreadsheet Information functions
- AREASCOLUMNCOLUMNSERRORTYPEINFOROWROWSSHEETSHEETSOther functions
-
OFFSET
Returns a modified reference, given a reference, an offset, and a desired size.
Syntax:
OFFSET(reference; row_offset; col_offset; new_height; new_width)
- reference is the given reference, which may be a range.
- row_offset and col_offset are the number of rows / columns to move reference down / right by. Negative numbers are allowed.
- new_height and new_width set the height and width of the new reference, by adjusting the bottom right corner. These are optional parameters.
Example:
=OFFSET(A1; 1; 2)
- in a cell, returns the contents of cell C2. The new_height and new_width parameters have been omitted.
=OFFSET(B3; -2; 0; 1; 1)
- in a cell, returns the contents of cell B1. A negative offset is allowed.
=SUM(OFFSET(A1; 2; 2; 2; 3))
- in a cell, returns the sum of the contents of cells C3:E4. 2 rows and 2 columns are added to A1, to offset it to C3, and then the new size extends the range to E4.
=SUM(OFFSET(C1:G1; 0; 0; 1; 3))
- in a cell, returns the sum of the contents of cells C1:E1.
Issues:
- The new_height parameter cannot be empty. Issue 3879 addresses this.
See Also
-