+ Reply to Thread
Results 1 to 3 of 3

Formula to find numbers that sum to a specified amount

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    60

    Formula to find numbers that sum to a specified amount

    Is there any way you can create a formula that would look through a bunch of numbers to see if the SUM of any combination of those numbers equals x (a specified amount)?

    For example, I have a column of numbers Rows 1-250, and I want to see if the SUM of any of those numbers equals a specified amount if added together. It could be 2 numbers added together or could even be more than 2. I would be specifying the amount manually. For instance, I want to see if any of the set of numbers' added together would equal 5,555.23. Would it be able to spit out the exact numbers that make up this specified amount?

    Thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,866

    Re: Formula to find numbers that sum to a specified amount

    This seems to come up from time to time. This can't be done with formulas but can be done with VBA or possibly with Solver, as described in a thread with the same question. Here is a VBA solution posted in a different forum.

    If you just need one combination I think the Solver solution may work for you. However, if you need to enumerate all possible solutions you start to tangle with the mathematical laws of universe as your list of numbers get large.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Formula to find numbers that sum to a specified amount

    Here is some code I did for a different thread:

    Goal is in cell A1
    Your numbers to potentially sum start in A2 and can extend to about A32
    Results are output starting in cell A3

    Please Login or Register  to view this content.
    Pauley

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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