+ Reply to Thread
Results 1 to 5 of 5

Offset - same formula produces different results

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Offset - same formula produces different results

    I am trying to learn variable ranges using =OFFSET but I cannot grasp the concept of why - apparently - the same formula produces two different results. It's obviously dependent on which cell is active but I cannot see where the formula references that. Any (simple) explanation welcomed!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Offset - same formula produces different results

    Hello,
    Here's my understanding.
    In your formula, from Cell A2, you offset 0 rows and 0 columns and then extract 12 rows and 1 column.
    Therefore the result is an ARRAY. To visualize it, go in your formula, press F2 then F9.

    Now because an array is returned, and you are in a single cell, let's say E10, Excel is returning the 9th value of that array because it started in A2. In E9, it will be the 8th value and so on...

    If you were to validate your formula as an Array Formula with CTRL+SHIFT+ENTER, you would get "January" every time (when selecting only one cell) because this is the first value of the array.

    If you select E10:E22, type your formula and validate with CTRL+SHIFT+ENTER, you'll get ALL the results.

    Not sure if my explanation is clear or not...
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

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

    Re: Offset - same formula produces different results

    =OFFSET(A$2,0,0,COUNTA(A:A)-1,1)

    It's because the height argument, COUNTA(A:A)-1, returns a number >1, in this case 12, and the formula is entered in a single cell so it returns the value that is within the implicit intersection of where the formula is entered.

    If you enter the formula in E15 you'll get an error because the formula is no longer within an implicit intersection of the data.

    What are you trying to do with that formula?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    807

    Re: Offset - same formula produces different results

    Got it! Finally. Thanks for taking the time, it's appreciated.

  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 - same formula produces different results

    Good deal. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple Search Criteria produces (list) Multiple results in a single cell
    By snake007uk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2014, 12:13 PM
  2. [SOLVED] Formula produces unexpected results
    By furface00 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-04-2014, 02:17 PM
  3. [SOLVED] Why the formula with #REF! still produces 0 value
    By alice2011 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-16-2014, 06:12 PM
  4. Same vba routine produces different results
    By john1674 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2013, 05:44 AM
  5. VLOOKUP/formula produces #N/A
    By ge0rge in forum Excel General
    Replies: 7
    Last Post: 03-26-2009, 10:17 AM
  6. returning offset results with a lookup formula
    By z2xm in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-19-2007, 12:02 PM
  7. visual basic conditional formatting produces strange results
    By Carl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 10:10 AM

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