Difference between revisions of "Documentation/How Tos/Calc: OFFSET function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
 
Line 1: Line 1:
{{Documentation/MasterTOC
+
{{DISPLAYTITLE:OFFSET function}}
|bookid=1234'''
+
{{Documentation/CalcFunc SpreadsheetTOC
|booktitle=<div style="padding: 8px; font-size: 140%; font-weight: bold; background-color: #9BC0F5;">CALC FUNCTIONS</div>
+
|ShowPrevNext=block
|ShowParttitle=block|parttitle=[[Documentation/How_Tos/Calc:_Spreadsheet_functions|<div style="font-size: 140%;">Spreadsheet Functions]]
+
|PrevPage=Documentation/How_Tos/Calc:_MATH_function
|ShowNextPage=block|NextPage=Documentation/How_Tos/Calc:_VLOOKUP_function
+
|NextPage=Documentation/How_Tos/Calc:_VLOOKUP_function
|ShowPrevPage=block|PrevPage=Documentation/How_Tos/Calc:_MATCH_function
+
}}__NOTOC__
|ShowPrevPart=block|PrevPart=Documentation/How_Tos/Calc:_Number_Conversion_functions
+
|ShowNextPart=block|NextPart=Documentation/How_Tos/Calc:_Statistical_functions
+
|toccontent= <div style="padding: 4px; font-size: 130%; font-weight: hidden; background-color:#DCE9FC;">FUNCTIONS</div>
+
 
+
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Spreadsheet Lookup functions</div>
+
* [[Documentation/How_Tos/Calc:_ADDRESS_function|<div style="font-size: 120%;">Address]]
+
* [[Documentation/How_Tos/Calc:_CHOOSE_function|<div style="font-size: 120%;">Choose]]
+
* [[Documentation/How_Tos/Calc:_HLOOKUP_function|<div style="font-size: 120%;">Hlookup]]
+
* [[Documentation/How_Tos/Calc:_INDEX_function|<div style="font-size: 120%;">Index]]
+
* [[Documentation/How_Tos/Calc:_INDIRECT_function|<div style="font-size: 120%;">Indirect]]
+
* [[Documentation/How_Tos/Calc:_LOOKUP_function|<div style="font-size: 120%;">Lookup]]
+
* [[Documentation/How_Tos/Calc:_MATCH_function|<div style="font-size: 120%;">Math]]
+
* [[Documentation/How_Tos/Calc:_OFFSET_function|<div style="font-size: 120%; border-style: double; border-color:#778899;">Offset]]
+
* [[Documentation/How_Tos/Calc:_VLOOKUP_function|<div style="font-size: 120%;">Vlookup]]
+
 
+
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Spreadsheet Information functions</div>
+
* [[Documentation/How_Tos/Calc:_AREAS_function|<div style="font-size: 120%;">Areas]]
+
* [[Documentation/How_Tos/Calc:_COLUMN_function|<div style="font-size: 120%;">Column]]
+
* [[Documentation/How_Tos/Calc:_COLUMNS_function|<div style="font-size: 120%;">Columns]]
+
* [[Documentation/How_Tos/Calc:_ERRORTYPE_function|<div style="font-size: 120%;">Errortype]]
+
* [[Documentation/How_Tos/Calc:_INFO_function|<div style="font-size: 120%;">Info]]
+
* [[Documentation/How_Tos/Calc:_ROW_function|<div style="font-size: 120%;">Row]]
+
* [[Documentation/How_Tos/Calc:_ROWS_function|<div style="font-size: 120%;">Rows]]
+
* [[Documentation/How_Tos/Calc:_SHEET_function|<div style="font-size: 120%;">Sheet]]
+
* [[Documentation/How_Tos/Calc:_SHEETS_function|<div style="font-size: 120%;">Sheets]]
+
 
+
<div style="font-size: 140%; border-style: outset outset outset none; border-color:#DCE9FC;">Other functions</div>
+
* [[Documentation/How_Tos/Calc:_DDE_function|<div style="font-size: 120%;">Dde]]
+
* [[Documentation/How_Tos/Calc:_HYPERLINK_function|<div style="font-size: 120%;">Hyperlink]]
+
* [[Documentation/How_Tos/Calc:_STYLE_function|<div style="font-size: 120%;">Style]]
+
}}__TOC__
+
  
 
== OFFSET  ==
 
== OFFSET  ==
Line 57: 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>
Line 63: Line 32:
  
 
=== Issues: ===
 
=== Issues: ===
*The <tt>'''new_height'''</tt> parameter cannot be empty. Issue 3879 addresses this (target OOo3.0).
+
*The <tt>'''new_height'''</tt> parameter cannot be empty. {{bug|3879}} addresses this.
*OFFSET(A1;{0|1};0;1;1) in an array formula returns unexpected results; see [http://qa.openoffice.org/issues/show_bug.cgi?id=86658 issue 86658].
+
  
 
{{SeeAlso|EN|
 
{{SeeAlso|EN|

Latest revision as of 11:18, 2 February 2024



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
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_OFFSET_function&oldid=259985"
Views
Personal tools
Navigation
Tools