+ Reply to Thread
Results 1 to 4 of 4

OFFSET function - column reference over the edge of the worksheet

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    5

    OFFSET function - column reference over the edge of the worksheet

    Hi there,

    I have a sum function with embedded offset function. My formula reference over the edge of the worksheet, thus, giving me an error message #Ref!. how do I put a constraint to be the maximum column A?

    For example, I have this formula in cell J2: SUM(I2:OFFSET(I2,0,-$R$1+1)) where $R$1=10

    Thanks

    Regards,
    Ronaldev

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

    Re: OFFSET function - column reference over the edge of the worksheet

    If there are only 9 columns from I2:A2 then why would you enter 10 in cell R1?

    Is there a formula in cell R1?

    What you should do is limit cell R1 to a max value of 9.

    You can do this with data validation.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: OFFSET function - column reference over the edge of the worksheet

    What range did you want that to evaluate to? You can change the formula to this:

    SUM(I2:OFFSET(I2,0,-min($R$1,COLUMNS($A:I))+1))

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    09-04-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: OFFSET function - column reference over the edge of the worksheet

    Hi Pete_UK,
    Thanks. The columns() is exactly what I am after. Awesome! My formula is now working.
    Cheers,
    Ronaldev

+ 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. Replies: 16
    Last Post: 12-24-2012, 06:21 AM
  2. Offset function isn't working - volatile reference
    By MrPez in forum Excel General
    Replies: 3
    Last Post: 08-20-2010, 05:12 AM
  3. OFFSET function with variable reference cell
    By smile2leksa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2009, 08:32 AM
  4. [SOLVED] Can the offset worksheet function reference another worksheet
    By AlistairJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2005, 02:06 PM
  5. Indirect/Offset Column Reference
    By aldsv in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-01-2005, 11:26 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