+ Reply to Thread
Results 1 to 14 of 14

how to find what values sum a particular value

Hybrid View

  1. #1
    Registered User
    Join Date
    03-19-2011
    Location
    panjim
    MS-Off Ver
    Excel 2007
    Posts
    7

    how to find what values sum a particular value

    hi all,

    I have a column A with more than 500 values in it, with various values there in it.

    how can i find what are the values, say 3-4 or even more which sum to a value say $5000.
    can the Respective cell no. be also displayed alongwith so that i can locate them.

    Cheers
    Anil

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: how to find what values sum a particular value

    There are 2.6 billion combinations of 2, 3, or 4 numbers out of 5000. Chances are, there are many, many, many of them total $5000. See http://www.excelforum.com/tips-and-t...tion-sums.html
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-19-2011
    Location
    panjim
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: how to find what values sum a particular value

    Quote Originally Posted by shg View Post
    There are 2.6 billion combinations of 2, 3, or 4 numbers out of 5000. Chances are, there are many, many, many of them total $5000. See http://www.excelforum.com/tips-and-t...tion-sums.html
    tx shg, for ur kind n quick response, i tried tushar mehta's code and the macro ran into application time error 1004 with following line highlighted for debugging "InArr = Application.WorksheetFunction.Transpose( _
    Selection.Offset(2, 0).Resize(Selection.Rows.Count - 2).Value)",
    tx

  4. #4
    Registered User
    Join Date
    03-19-2011
    Location
    panjim
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: how to find what values sum a particular value

    tx shg for ur help, i tried tushar mehta's code, but application time error 1004 is coming, with following line highlighted there. "InArr = Application.WorksheetFunction.Transpose( _
    Selection.Offset(2, 0).Resize(Selection.Rows.Count - 2).Value)"

    kinldy help on this

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: how to find what values sum a particular value

    Post a workbook with your values?

  6. #6
    Registered User
    Join Date
    03-19-2011
    Location
    panjim
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: how to find what values sum a particular value

    Quote Originally Posted by shg View Post
    Post a workbook with your values?
    Tx for your kind response shg,

    Please find attached the workbook "test.xlsx"

    Regards

    Anil
    Attached Files Attached Files

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: how to find what values sum a particular value

    With your 1857 numbers in col B, I found 6800+ solutions to 4 or fewer number totalling $5000.00. It was 38 seconds into the process, evaluating 1% of the possibilities when I shut it down. Do you see the problem?
    Last edited by shg; 03-22-2011 at 01:58 PM.

  8. #8
    Registered User
    Join Date
    03-19-2011
    Location
    panjim
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: how to find what values sum a particular value

    Quote Originally Posted by shg View Post
    With your 1857 numbers in col B, I found 6800+ solutions to 4 or fewer number totalling $5000.00. It was 38 seconds into the process, evaluating 1% of the possibilities when I shut it down. Do you see the problem?
    Tx shg, for all ur kind efforts, i now understand the problem..............

    but, to still reduce the manual search & match process, can a code in VBA be written 1. which searches a value , say $5000, in cell A5, matches the exact amount i.e. $5000 in column B somewhere, say B56. Then it deletes both the rows.i.e. row 5 & row 56
    2. or if we go a bit further, 2 or 3 combinations in column b somewhere, for example, say for $5000, in cell A5, and $1000, $2500 & $1500 in say, cell no.s B10,B25&B65 respectively, it matches & all rows i.e. 5,10,25&65 are deleted.


    This can kind of reduce few minutes of mine.

    tx again for your kind help

  9. #9
    Registered User
    Join Date
    03-19-2011
    Location
    panjim
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: how to find what values sum a particular value

    Tx a lot shg, im so thankful to you.........

    it helped me to cut my search time................

    really appreciate your efforts, tx once more

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: how to find what values sum a particular value

    You're welcome, good luck.

  11. #11
    Registered User
    Join Date
    05-07-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Smile

    Required help, not able to work on this
    Last edited by sandy789; 05-07-2011 at 04:31 PM.

+ 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