+ Reply to Thread
Results 1 to 6 of 6

How to identify/mark rows in a column that equals a sum..

  1. #1
    Registered User
    Join Date
    07-23-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    3

    How to identify/mark rows in a column that equals a sum..

    Hi everyone,

    I'm Jojo from Philippines and i have been working on one project about excel...

    i need help in identifying number of rows (numeric) in a column that is equal to a certain sum derived from the same column of numbers...

    example:

    Column A:
    1
    2
    3
    4
    5
    6
    7
    8

    25 - is the given sum

    question: identify the numbers that will total to the given sum above, if exact total is not possible from the given series of numbers then it will say not possible, but if found the exact combination of numbers then it will change the text color from default black to blue.


    Thank you in advance,

    Jojo Aguirre
    Attached Files Attached Files
    Last edited by Stealth1965; 08-22-2011 at 03:50 AM. Reason: file attached...

  2. #2
    Registered User
    Join Date
    05-13-2011
    Location
    New Zealander in London
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: How to identify/mark rows in a column that equals a sum..

    This is an extremely difficult one to solve. Basically you want a macro (as this cannot be done with a simple formula) to work out every unique combination of values and find which one adds up nearest to the value.

    Unfortunately I cannot think of an easy way to get every unique combination.

    What I have attached is close, but still does not do exactly what you're after. It is a good starting point for somebody who might know how to work out all of the different combinations though.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-23-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to identify/mark rows in a column that equals a sum..

    Quote Originally Posted by tarquinious View Post
    This is an extremely difficult one to solve. Basically you want a macro (as this cannot be done with a simple formula) to work out every unique combination of values and find which one adds up nearest to the value.

    Unfortunately I cannot think of an easy way to get every unique combination.

    What I have attached is close, but still does not do exactly what you're after. It is a good starting point for somebody who might know how to work out all of the different combinations though.
    @tarquinious... thank you very much just for replying, i really appreciate the information of knowing the level of difficulty of this particular project.

    To anyone, please help me solve this....

  4. #4
    Valued Forum Contributor
    Join Date
    11-11-2008
    Location
    Euro
    MS-Off Ver
    2007, 2010
    Posts
    470

    Re: How to identify/mark rows in a column that equals a sum..

    Quote Originally Posted by Stealth1965 View Post
    @tarquinious... thank you very much just for replying, i really appreciate the information of knowing the level of difficulty of this particular project.

    To anyone, please help me solve this....
    You can by SOLVER for the solution to find the combination and then using the format conditional to color the text
    Best regard, -)iger-/iger
    If you are pleased with a solution mark your post SOLVED.

  5. #5
    Registered User
    Join Date
    07-23-2009
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: How to identify/mark rows in a column that equals a sum..

    Thank you Tigertiger... i will try it as you adviced, however, can you send me what formula do yo have in mind?...


    God bless

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: How to identify/mark rows in a column that equals a sum..

    It is as tarquinious says extermly difficult to solve.

    I did a test run with solver (Excel 2003) and got a difference between target value and solver value of 0,05.

    Still this is only one solution and there are a lot more solutions. I also did sort the values before running Solver. A thing that probably influence the result.

    Tushar Mehta has some example on how to solve problem like this:

    http://www.tushar-mehta.com/excel/te.../match_values/

    I've uploaded an excel file with the Solver parameter. Before running solver clear range C3 to C33.

    Alf
    Attached Files Attached Files

+ 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