+ Reply to Thread
Results 1 to 12 of 12

Replace OFFSET in SUM()

  1. #1
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Replace OFFSET in SUM()

    Hi

    I have a formula that Sums a range using OFFSET. This ensures that if a row is inserted immediately above the SUM then the value will be included. However, the OFFSET is volatile. Is there an alternative to OFFSET - can I use INDEX somehow?

    Thanks for any ideas

    Allister
    Attached Files Attached Files
    Last edited by AllisterB; 08-09-2022 at 09:07 PM.

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

    Re: Replace OFFSET in SUM()

    Do you always want to sum from the row immediately above the cell with the formula in up a certain number of cells, or to D5 each time?

    Pete

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: Replace OFFSET in SUM()

    You do realise that the formula, as presented, missed out the last row of data (immediately before the formula)?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: Replace OFFSET in SUM()

    What, if anything, is above and/or below the column of data and the sum formula?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: Replace OFFSET in SUM()

    Assuming nothing below,
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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

    Re: Replace OFFSET in SUM()

    Or, by using column C contents to determine the bottom value:

    =SUM(D$1:INDEX(D:D,COUNTA(C:C)+2))

    Note that this mirrors your existing approach and ignores the value immediately above the cell with the formula (but always starts with D5). Change the +2 to +3 if you want to include all the values.

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: Replace OFFSET in SUM()

    Hi

    I have updated eth sample file to show content above and below the range to sum.
    I have also corrected the SUM formula

    Thank You

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: Replace OFFSET in SUM()

    Maybe this then:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: Replace OFFSET in SUM()

    Thank You - it works nicely...

  10. #10
    Forum Contributor
    Join Date
    07-10-2020
    Location
    New Zealand
    MS-Off Ver
    365 personal
    Posts
    302

    Re: Replace OFFSET in SUM()

    Hi Pete
    A nice solution - Thanks

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: Replace OFFSET in SUM()

    You're welcome. Thanks for the rep.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,380

    Re: Replace OFFSET in SUM()

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Replace OFFSET with INDEX
    By anasaa42 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-11-2022, 09:43 PM
  2. [SOLVED] Replace Offset with Index
    By yarlachiru in forum Excel General
    Replies: 7
    Last Post: 01-22-2021, 04:43 AM
  3. How to replace Offset() with non-volatile formulas?
    By ceeyee in forum Excel General
    Replies: 14
    Last Post: 12-06-2018, 06:40 PM
  4. [SOLVED] INDEX to replace OFFSET
    By esbencito in forum Excel General
    Replies: 9
    Last Post: 03-14-2018, 02:20 AM
  5. [SOLVED] Need to replace formulaarray and offset in to other VBA code
    By vizzkid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 07:18 AM
  6. Find All and Replace Offset Value
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2011, 12:56 PM
  7. Replace using Offset
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-23-2011, 03:20 PM

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