+ Reply to Thread
Results 1 to 16 of 16

How to add values using another value until another value is reached

Hybrid View

Car7os How to add values using... 01-08-2014, 09:24 AM
Sam Capricci Re: How to add values using... 01-08-2014, 09:31 AM
Car7os Re: How to add values using... 01-08-2014, 09:45 AM
Car7os Re: How to add values using... 01-08-2014, 09:50 AM
Sam Capricci Re: How to add values using... 01-08-2014, 09:55 AM
Car7os Re: How to add values using... 01-08-2014, 10:05 AM
Sam Capricci Re: How to add values using... 01-08-2014, 10:35 AM
alvin-chung Re: How to add values using... 01-08-2014, 11:18 AM
Car7os Re: How to add values using... 01-08-2014, 11:25 AM
alvin-chung Re: How to add values using... 01-08-2014, 11:35 AM
Sam Capricci Re: How to add values using... 01-08-2014, 11:40 AM
Car7os Re: How to add values using... 01-08-2014, 11:41 AM
Sam Capricci Re: How to add values using... 01-08-2014, 11:50 AM
Car7os Re: How to add values using... 01-08-2014, 11:54 AM
Sam Capricci Re: How to add values using... 01-08-2014, 11:59 AM
alvin-chung Re: How to add values using... 01-08-2014, 11:59 AM
  1. #1
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Question How to add values using another value until another value is reached

    Hi everyone, Sorry for the confusing title but couldn't think how to describe it! I'm stuck on a formula at work and wondered if you can help?


    excel.JPG

    What I need to do is where there is a value in column D add all the values in column F until another value appears in column D again, then continue to do the same down the sheet.

    Any help would be great.

    Carl

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,700

    Re: How to add values using another value until another value is reached

    So just to be clear (and i'm not sure this can be done) you want, where the value 7.33 is in cell D2, a formula that would add the values in F2, F3 and F4, then replace the 7.33 with those numbers? Is that correct?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to add values using another value until another value is reached

    No sorry, I knew my explanation sounded ok in my head but not on paper!

    Where 7.33 is in D2, a formula say in the G column to add the values in F2, F3 and F4 together then when 7.33 is reached again in column D start again fresh so values F5 and F6 are totalled seperatly

  4. #4
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to add values using another value until another value is reached

    excel2.JPG

    Giving this result

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,700

    Re: How to add values using another value until another value is reached

    so I don't have to try to recreate your data is it possible for you to post the sample you are using instead of posting jpgs? Go advanced to do that, make sure any confidential / proprietary data is removed.

  6. #6
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to add values using another value until another value is reached

    No problem, I'm trying to automate the yellow column rather than me having to manually go through months worth of data!

    Cheers
    Attached Files Attached Files

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,700

    Re: How to add values using another value until another value is reached

    this would be one way though it is a bit sloppy, hopefully someone else has a better way and I'll keep thinking about it.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: How to add values using another value until another value is reached

    Hi Carl, try this array formula in G2 and copy down till G36.
    ps: press ctrl+shift+enter instead of enter for array formula

    Formula: copy to clipboard
    {=IF(D2<>"",SUMPRODUCT(F2:F$36*(ROW(D2:D$36)-ROW(D2)<IFERROR(MATCH(TRUE,D3:D$36<>"",0),ROW(D$36)-ROW(D2)+1))),"")}




    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  9. #9
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to add values using another value until another value is reached

    Thanks Sambo kid and Alvin-chung

    Both are close, Sambo has the right result but Alvin you have the right layout with the spaces but the wrong end result as it adds the results together, I need seperate results.

    Very much appreciate your help.

  10. #10
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: How to add values using another value until another value is reached

    Hi Carl, I think you didn't use array formula as ps in my earlier post
    Try click on cell G2, delete it, press F2, copy paste the formula below and hit ctrl+shift+enter (not just enter)
    Formula: copy to clipboard
    =IF(D2<>"",SUMPRODUCT(F2:F$36*(ROW(D2:D$36)-ROW(D2)<IFERROR(MATCH(TRUE,D3:D$36<>"",0),ROW(D$36)-ROW(D2)+1))),"")




    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  11. #11
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,700

    Re: How to add values using another value until another value is reached

    Look at column L on this one...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to add values using another value until another value is reached

    Spot on, thank you, I pressed Ctrl-Alt-Enter instead! so used to Ctrl-Alt-Dlt I think!

    What does Controll-Shift-Enter do exactly?

  13. #13
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,700

    Re: How to add values using another value until another value is reached

    http://office.microsoft.com/en-us/ex...001087290.aspx
    A quick introduction to arrays and array formulas
    If you've done even a little programming, you've probably run across the term array. For our purposes, an array is just a collection of items. In Excel, those items can reside in a single row (called a one-dimensional horizontal array), a column (a one-dimensional vertical array), or multiple rows and columns (a two-dimensional array). You can't create three-dimensional arrays or array formulas in Excel.

    An array formula is a formula that can perform multiple calculations on one or more of the items in an array. Array formulas can return either multiple results or a single result. For example, you can place an array formula in a range of cells and calculate a column or row of subtotals. You can also place a formula in a single cell and calculate a single amount. An array formula that resides in multiple cells is called (logically enough) a multi-cell formula, and an array formula that resides in a single cell is called a single-cell formula.

    The examples in the next section show you how to create multi-cell and single-cell array formulas.

    <><><><>
    BTW, w/my change you can get rid of the values in columns I, J and K and only use the added column C for the concatenation.

  14. #14
    Registered User
    Join Date
    06-04-2013
    Location
    Nottinghamshire, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to add values using another value until another value is reached

    Thanks Sambo and Alvin, you've been a great help.

  15. #15
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,700

    Re: How to add values using another value until another value is reached

    Glad I could help as I'm sure Alvin is too. And thanks for the bump to the reputation.
    Don't forget to mark the post as solved using thread tools at the top of the post.

  16. #16
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: How to add values using another value until another value is reached

    Hi Carl, you're welcome and thank you for your feedback
    Thanks Sambo for the explanation of array formula.



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

+ 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: 2
    Last Post: 08-01-2013, 04:49 AM
  2. Replies: 2
    Last Post: 04-30-2013, 05:57 AM
  3. [SOLVED] have values in column change color after a certain total is reached
    By patrickmcdiver in forum Excel General
    Replies: 9
    Last Post: 04-24-2012, 09:29 AM
  4. Replies: 1
    Last Post: 04-24-2012, 12:17 AM
  5. Trigger once certain age has been reached
    By Ducatisto in forum Excel General
    Replies: 9
    Last Post: 08-31-2010, 03:16 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