Solved

Understanding offset function

Posted on 2011-02-13
4
304 Views
Last Modified: 2012-05-11
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
Comment
Question by:Excellearner
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
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

by:sedgwick
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

by:
barry houdini earned 500 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

by:Excellearner
ID: 34954316
Barry, superb as usual
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now