Offset function in Excel - Usage and examples
The OFFSET function in Excel is a function of the reference and search function group, the following article will describe the syntax, usage and examples of the OFFSET function in Excel, please refer to to understand more about the OFFSET function. .
Description
The Offset function returns a reference to a range a number of rows and a range of cells a specified number of rows and columns. This means that the Offset function returns a reference to a range, based on the position of the cell or the range of cells you specify as a landmark, and moves according to the number of rows and columns you specify.
The reference that the Offset function returns can be a single cell or a range of cells where you specify the number of rows and columns to return.
Syntax
= OFFSET (reference; rows; cols; [height]; [width])
Inside:
- reference is the required argument, is the reference area that you want this to be the starting point (as a landmark) and then based on other arguments to move to the reference reference.
- rows is a required argument, is the number of rows you want to move up or down the reference . If rows are positive, the function will move below the reference , if rows are negative then move up to the reference.
- cols is a required argument, is the number of columns you want to move left or right reference after the function has moved in rows. If cols is positive, the function will move to the right number of cells equal to the number of cols , if the number of cols is negative, the function will move to the left of the cell number by the number of cols .
- height is an optional argument, this is the height calculated by the number of rows you want for the reference to return.
- width is an optional argument, this is the width calculated by the number of columns you want for the reference to return.
Note
- If the rows and cols arguments cause the returned reference area to go beyond the sheet border, the function will return the #REF error value.
- If height and width are omitted in the OFFSET function, the default return reference has the same height and width as the reference region.
- If height and width > 1 means that the function must return more than 1 cell, you must use the array formula OFFSET function otherwise it will get #VALUE!
- The height and width arguments must be positive.
- The OFFSET function does not actually move any cells or change the selection, it only returns a reference.
For example
1. Returns the reference of 1 cell starting from D8, moving down 3 rows to the right by 2 columns.
Use the following formula: = OFFSET (D8; 3; 2)
2. Returns the reference of 2 cells C10: C11 starts from cell D8, moves down 2 rows, to the left by 1 column.
If you just write the OFFSET formula formula = OFFSET (D8; 2; -1; 2; 1) , the function will return the #VALUE! Error. Because this example returns the reference of 2 cells, you need to apply the array formula.
Since the reference returned as 2 cells C10: C11 should you choose any two adjacent cells in a column, then enter the function = OFFSET (D8; 2; 1; 2; 1) entering these you press the Ctrl + Shift + Enter to convert to an array formula. You will get the following result:
4. Use the OFFSET function in combination with the SUM function to sum the returned range.
If you return a reference with multiple cells, you need to write the array formula as in the above example, but if combined with the SUM function, you do not need to use array formulas anymore. You enter the function = SUM (OFFSET (D8; 2; -1; 2; 1))
4. Apply a specific example using the SUM function in combination with OFFSET
When the data is always changing, the OFFSET application is very useful instead of changing the SUM formula every time.
Suppose you have data as shown below.
Every day you have new data, so you have to add new rows to the data table.
You don't want to have to change the SUM formula every time you add data. Please apply the OFFSET function to automatically change when adding new data. In the sum cell you use the formula
= SUM (D7: OFFSET (D14; -1; 0))
The SUM function sums from the first cell in the Revenue column that is cell D7 to the returned reference of the OFFSET function. The OFFSET function returns the reference that is the position in the Total revenue row 1 row, which is the D13 position as shown.
Thus, when you add new rows or delete rows in a data table, the OFFSET formula will update the corresponding position directly above the Total sales cell, and the SUM function will calculate the total more flexibly.
Above the article has introduced to you the syntax, usage and examples of Excel OFFSET function. Hopefully, you will have a better understanding of how to use the OFFSET function and how to apply the OFFSET function to specific cases. Good luck!
You should read it
- Function Address - The function returns the address of a cell in Excel (usage, examples, examples)
- OR function in Excel, how to use the OR function, and examples
- PMT function in Excel - Usage and examples
- DCOUNT function in Excel - Usage and practical examples
- FIND function in Excel - Usage and examples
- Match function in Excel - Usage and illustrative examples
- VLOOKUP function to use and specific examples
- ROUNDUP function in Excel - Usage and examples
May be interested
- How to combine IF, AND and OR functions to filter datahow to combine if, and and or functions to filter data if you only use the if function, the and function and the or function, you cannot see the full usefulness of these functions in excel. the following article will combine the if function, the and function and the or function to make jars
- The search function satisfies many conditions in Excel - Usage and examplesthe search function satisfies many conditions in excel - usage and examples. in the process of processing data in excel many times you need to search for data that satisfies many conditions to extract data, so you are looking for a function that satisfies many things.
- How to show the ruler in Word 2010 and the rule bar in Word 2010how to show the ruler in word 2010, the rule bar in word 2010. in the process of working with word 2010, you accidentally see the vertical ruler and the horizontal ruler, also known as the ruler bar. you are not sure how to display two ruler bars to c
- How to display rules in Word 2013 and 2016 - How to display rule bars in Word 2013 and 2016how to show the ruler in word 2013 and 2016 - how to display the rule bar in word 2013 and 2016. you use word 2013 and 2016 to edit documents, but in the process of working, you do not see the vertical and horizontal ruler. . and you guys don't know how to hi yet
- Spacing lines in Excelspacing lines in excel. in the process of editing excel file, sometimes the lines are not spaced as expected or the lines are not spaced evenly. so you want to evenly line the data in excel. the following article will guide fish
- Create dots in Word, how to create dots lines, tab line dots (.........) in Wordcreate dots in word, how to create dots lines, tab line dots (.........) in word. students writing essays, projects, or paper forms will often have dotted lines to fill in the content. if you often have to draft these documents, you cannot enter them