+ Reply to Thread
Results 1 to 5 of 5

Variable Row # Sums

  1. #1
    Registered User
    Join Date
    04-21-2010
    Location
    Boston, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Variable Row # Sums

    Apologies if this question has been answered before, I haven't had any luck searching. It seems very basic but it's completely stumping me: how do I add a formula which can sum from the cell above it to a point further above, determined based on an adjacent column. So for example:

    A B
    1 Entry 1 5
    2 Entry 2 6
    3 TOTAL X
    4 Entry 3 12
    5 TOTAL Y


    In the above, X should be 11 and Y should be 12. How can I use the same formula in both to get the correct answers?

    Thanks!
    Last edited by King of Ka; 07-21-2019 at 02:34 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Variable Row # Sums

    This in B3, B5 and any 'Total' row will do what you want.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It may not be particularly efficient if your list if VERY long.
    I'll have a think on it for a better solution.

    B.
    Last edited by BanginMyHeadOnMyDesk; 07-21-2019 at 02:46 PM.

  3. #3
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Variable Row # Sums

    I don't believe you can use the same formula to get the sum of separate ranges which vary in scope. Even using SumIf() the criteria would have to change in the formula to separate the two ranges of values.

    but for a one shot deal,

    Please Login or Register  to view this content.
    Last edited by JLGWhiz; 07-21-2019 at 03:05 PM.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  4. #4
    Registered User
    Join Date
    04-21-2010
    Location
    Boston, USA
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Variable Row # Sums

    Quote Originally Posted by BanginMyHeadOnMyDesk View Post
    This in B3, B5 and any 'Total' row will do what you want.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It may not be particularly efficient if your list if VERY long.
    I'll have a think on it for a better solution.

    B.
    This worked like a charm! Table isn't long and never will be, so this should do it. Thanks!!

  5. #5
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Variable Row # Sums

    Glad I could help

    B.

+ 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. [SOLVED] Can't automate sums of variable Textboxes in User Form
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2019, 07:58 AM
  2. [SOLVED] Auto calculate totals and sums based on variable numbers
    By bennadelaidefringe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-03-2015, 12:00 AM
  3. Unable to enter a cell formula that sums a variable using VBA
    By Jing3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-27-2013, 05:56 PM
  4. Independently variable entries, total sums to 100%
    By joefrankenheimer in forum Excel General
    Replies: 4
    Last Post: 05-14-2012, 08:47 AM
  5. adding variable sums from different cells
    By ioneabee in forum Excel General
    Replies: 5
    Last Post: 05-13-2010, 04:09 AM
  6. Variable Sums
    By SeattleDuck in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-16-2009, 10:31 AM
  7. Lookups and variable sums
    By brentm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-07-2005, 08:06 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