+ Reply to Thread
Results 1 to 8 of 8

=SUM Combination In Order To Find Specific Value For Large Amount of Data

  1. #1
    Registered User
    Join Date
    04-08-2017
    Location
    N/A
    MS-Off Ver
    2016
    Posts
    30

    =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Hello all,

    Basically I want to derive a specific value through the every possible SUM combination of range of values.

    Please find attached a simple example I made.

    Thanks in advance.
    Attached Files Attached Files
    Last edited by KMVKMVKMV; 05-02-2017 at 08:57 AM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Looks like a standard "subset sum problem" (https://en.wikipedia.org/wiki/Subset_sum_problem ). Most solutions in Excel that I see use the Solver add-in (http://www.get-digital-help.com/2010...Speed=noscript ). Note that, as an NP-complete problem, as the problem gets larger, it takes a lot longer to compute, with no efficient algorithms to improve the solution. There are approximation algorithms that may be useful, and you may want to research those if your real problem is too large.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Hi,

    Why isn't:

    =SUM(A4)

    a possibility? How many values should be considered?

    And if there exists more than one combination of values whose sum is equal to the target value, which should be preferred?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Registered User
    Join Date
    04-08-2017
    Location
    N/A
    MS-Off Ver
    2016
    Posts
    30

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Hi XOR LX,

    Yes, the combination should be of at least two cells (might be more) in order to derive the target value. I don't know how many combinations will give me the targeted value.
    Last edited by KMVKMVKMV; 05-02-2017 at 09:24 AM.

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Quote Originally Posted by KMVKMVKMV View Post
    Hi XOR LX,

    Yes, the combination should be of at least two cells (might be more) in order to derive the target value.
    And my second question?

    Using worksheet formulas only, you'll be restricted to no more than 20 values:

    https://excelxor.com/2015/02/10/whic...ple-solutions/

    Some VBA or MrShorty's advice would be advisable in such cases.

    Regards

  6. #6
    Registered User
    Join Date
    04-08-2017
    Location
    N/A
    MS-Off Ver
    2016
    Posts
    30

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Thanks for your suggestions.

    Can you think of other ways (besides VBA) to derive the target value?

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    I'm sure we can think of other ways. It might help us if we understood what you feel is missing from the existing recommendations.

    If the spreadsheet is programmed correctly, Solver should be able to find a solution. It may take a long time on larger variations of this problem, but it should be able to find one.

    I could see one programming their own "find every possible combination" algorithm, then use that to test and find which combinations sum up to the desired value. Here's a starting place I came up with for generating permutations without VBA that may serve as a starting point https://www.excelforum.com/tips-and-...ml#post4640511

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: =SUM Combination In Order To Find Specific Value For Large Amount of Data

    Here's another discussion for subset sum problems: https://www.excelforum.com/excel-for...ml#post4544017

+ 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: 7
    Last Post: 03-20-2016, 12:06 PM
  2. [SOLVED] How to find large amount number/letter sequences effectively from a table
    By keitto in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-30-2015, 07:43 AM
  3. Pasting large amount of data
    By fredrbcc in forum Excel General
    Replies: 1
    Last Post: 02-13-2015, 09:38 PM
  4. Replies: 5
    Last Post: 10-24-2014, 09:13 AM
  5. [SOLVED] Applying a formula to a large specific amount of cells in a column
    By alcorp in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2014, 05:30 PM
  6. [SOLVED] Find specific data combination on another sheet using command button.
    By Ataraxicatom in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-08-2012, 09:55 AM
  7. Replies: 19
    Last Post: 01-12-2012, 05:50 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