+ Reply to Thread
Results 1 to 6 of 6

Offset - Setting a dynamic range

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    2

    Offset - Setting a dynamic range

    Hello,

    I'm learning some stuff about excel and I came across the usage of the Offset function to some specific data into dynamic data. So the function example is this one: OFFSET(DynamicRangeSum!$C$5;0;0;1;COUNTA(DynamicRangeSum!$C$5:$M$5)).
    How can this function get the values from a dynamic range if we're limiting its range to C5:M5?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Offset - Setting a dynamic range

    Why can't a dynamic range be limited to a certain range?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Offset - Setting a dynamic range

    As COUNTA counts the number of non-empty cells, the width of the range might vary from 1 to 11 depending on how many non-empty cells there are in the range - So, it is dynamic

    FYI as OFFSET is volatile, using INDEX is a more stable alternative
    Last edited by Pepe Le Mokko; 04-02-2013 at 10:12 AM.

  4. #4
    Registered User
    Join Date
    04-02-2013
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Offset - Setting a dynamic range

    So imagining the situation that we've a range of data in C5:H5 and we name it RevenueData. And then there's in another cell the formula =SUM(RevenueData), the author I'm reading claims that if you insert data on I5 this SUM wouldn't be able to capture it (until here understood), but with that OFFSET it would capture everything.
    But if I'm doing this OFFSET from C5:M5 why not just do SUM(C5:M5)? Or name RevenueData to C5:M5 and then just do SUM(RevenueData)? What's the advantage of using the Offset in here?

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Offset - Setting a dynamic range

    A dynamic range is used when you will be adding data to the end of the data range so there is not a specific end of range. You may not know how much data you'll be adding and sometimes, using an arbitrary end of range is not efficient depending on what type of functions you use to reference the range.

    Some functions ignore empty cells while others do not. So, you may want to use a dynamic range so any calculations aren't being done on empty unused cells.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Offset - Setting a dynamic range

    Again, the introduction of the ;COUNTA(DynamicRangeSum!$C$5:$M$5) will limit the length of the range to the number of non-empty cells between C and M
    So If there are three cells containing something, the SUM will sum range C5:E5. Why one would want to do this is not quite clear
    To see your formula at work, use the Evaluate formula tool

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Offset - Setting a dynamic range

    For some reason this thread does not appear in my Subscribed Threads folder.

    So, I'm posting this reply to see if it gets updated (so I can follow the conversation).

    EDIT: The Subscribed Threads folder has updated.
    Last edited by Tony Valko; 04-02-2013 at 02:28 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1