Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Understanding offset function

Posted on 2011-02-13
Medium Priority
332 Views
Dear experts,

I have the below formulae,

=IF(COUNT(MATCH(C4,'data elements'!B3:K3,0)*MATCH(E3,'data elements'!A4:A9,0)),INDEX(OFFSET('data elements'!B4:K9,MATCH(B2,'data elements'!A2:A22,0)-1,0),MATCH(E3,'data elements'!A4:A9,0),MATCH(C4,'data elements'!B3:K3,0)),0)

What i want to understand is how does the function 'offset' and ')-1' work, what is the logic of this.

'INDEX(OFFSET('data elements'!B4:K9,MATCH(B2,'data elements'!A2:A22,0)-1,0),'

Thank you
0
Question by:Excellearner
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 42

Expert Comment

ID: 34882607
The syntax for the Offset function is:

Offset( range, rows, columns, height, width )

range is the starting range from which the offset will be applied.

rows is the number of rows to apply as the offset to the range. This can be a positive or negative number.

columns is the number of columns to apply as the offset to the range. This can be a positive or negative number.

height is the number of rows that you want the returned range to be.

width is the number of columns that you want the returned range to be.

http://www.techonthenet.com/excel/formulas/offset.php

0

LVL 42

Expert Comment

ID: 34882613
so to your question -1 is the height relatively the range parameter.
so if range is C4, -1 as height parameter yields C3
0

LVL 50

Accepted Solution

barry houdini earned 2000 total points
ID: 34882629
In this version of OFFSET

OFFSET('data elements'!B4:K9,MATCH(B2,'data elements'!A2:A22,0)-1,0)

only three arguments are used, range, rows and columns. Height and width are omitted which means that the height and width will remain as per the range.

Column argument is zero so the range will not only remain the same size as range but it will only move vertically. The amount it moves is determined by MATCH function, so if B2 matches the first cell in the MATCH range, i.e. data elements'!A2 then MATCH returns 1 and with -1 that means that the original range is supplied by the OFFSET function.....but if B2 matches with, say, data elements'!A12 then MATCH returns 11 and with -1 that means that the range is just moved down 10 rows and becomes

'data elements'!B14:K19

regards, barry
0

Author Closing Comment

ID: 34954316
Barry, superb as usual
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
###### Suggested Courses
Course of the Month11 days, 9 hours left to enroll