Closed Thread
Results 1 to 5 of 5

Prioritizing items: trying to speed up a cumulative sum - sumproduct

  1. #1
    Registered User
    Join Date
    04-30-2012
    Location
    Ghoft icafere
    MS-Off Ver
    Excel 2010
    Posts
    5

    Prioritizing items: trying to speed up a cumulative sum - sumproduct

    Hi all,
    I am trying to do the following:
    - I have a list of items (say cars), one on each line, and attached there is the name of the owner and the value of the car
    - I need to pick up the first n most valuable cars for each owner up to a value of x
    - every car that makes me exceed the total value of x has not to be picked up

    My attempt:
    - List the cars from the most expensive to the cheapest
    - For each line sum the value of the previous cars belonging to the same owner
    - So you have a cumulative sum *for each owner*
    - In a second column, I flag the lines in which the value exceeds x

    Seems simple but excel experiences huge difficulties in calculating the cumulative sum, probably because I am working on more than 20k lines.
    It takes ages to calculate and I never managed to paste values to save my work.

    I tried to obtain this result using a sumproduct [=SUMPRODUCT((D13=D13:$D$13)*(AB13:$AB$13))] where column D is the name of the owner and column AB is the value of the car.
    I tried to do the same using sumif, but seems even worse.

    I am running excel 64bit on a i7 with 8gb RAM, so the HW/resources should not be the problem.
    Is there a smarter way to do this without using VBA?

    Hope you can help me because this issue is really blocking me....
    Thanks a lot
    C

  2. #2
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re: Prioritizing items: trying to speed up a cumulative sum - sumproduct

    "am working on more than 20k lines." >> 10^3 lines => VBA

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Prioritizing items: trying to speed up a cumulative sum - sumproduct

    Thats a lot of cars..perhaps upload a sample worksheet alongwith your desired results..
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Prioritizing items: trying to speed up a cumulative sum - sumproduct

    sumif should be quicker than sumproduct
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Prioritizing items: trying to speed up a cumulative sum - sumproduct

    The OP has opened a new thread here: http://www.excelforum.com/excel-prog...82#post2849282

Closed Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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