+ Reply to Thread
Results 1 to 3 of 3

Find and show sum of values that equal a specific number

  1. #1
    Registered User
    Join Date
    12-16-2011
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Find and show sum of values that equal a specific number

    Hi,

    I am really stumped here and am hoping one of you can help me out.

    So say I have a column containing 100, 1000, or even 10,000 rows of numbers and I want to find any and all combinations of numbers in that column that equals a specific number.

    For example,

    Column A
    10
    -9
    3
    3
    89
    -43
    15


    I want to know if any combination of those numbers equals, say 86, (which would be -9, 3, 3, and 89) and then identify those rows where the sum exists.

    Any help would be much appreciated, Let me know if you need more details or I'm not clear enough.

    Thanks!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Need VBA code: find and show sum of values that equal a specific number

    Hi nplouffe and welcome to the forum,

    I did a problem like this a while back. Find my answer attached when there are exactly 3 numbers that add to the total. See if the attached example gets you closer to an answer. You need to read the VBA Code to see how it works.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    12-16-2011
    Location
    canada
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Need VBA code: find and show sum of values that equal a specific number

    Thanks MarvinP, this is a great start!

    The numbers I am working with are dollar values, and in using the random formula, this can take a long time to find a specific number. Do you know if I can have 5 or so columns doing this search all at the same time? Basically run 5 times faster?

    Thanks!

+ 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