+ Reply to Thread
Results 1 to 9 of 9

To find all combinations of numbers from list of numbers that adds upto a specified number

  1. #1
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    To find all combinations of numbers from list of numbers that adds upto a specified number

    hiii..

    Suppose I have 1 to 10 written in A1 to A10 (there can be any random numbers & of random size)

    I want to find all combinations of numbers that adds upto say 7 (which I will specify)

    so I want all combinations from 1 to 10 that adds upto 7 (each combination in different column)

    The combinations here would be i guess 1,6 2,5 3,4 1,2,4.

    No repetitions / duplicates allowed..also 1,6 same as 6,1 so want it once only..

    attached image of my query for more clarity..

    Thanks.
    Attached Images Attached Images

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    Try this:-
    Numbers in column "A", Place your number, 7 in this case, in "B1"
    Results start "F1".
    Please Login or Register  to view this content.
    Regards Mick
    Last edited by MickG; 01-05-2019 at 07:18 AM.

  3. #3
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    Hii Mick..that code works wonders..thank you so much for the efforts to make the code..appreciable!!

    a small issue...

    When I write 9 in B1 & run the code column I gives combination of 4 5 5 i.e. the extra 5 in row 3..other everything is perfect..

    same issue with 10..Column I gives 4 6 & 5...

    I know it's a very small bug for you to be rectiifed..

    Thanks a lot once again..

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    I can't duplicate that , but have added a line to clear cells to right of column "F" and down before new results are added.
    Please Login or Register  to view this content.
    Regards Mick

  5. #5
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    Awesome..Thank you so much mike...

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    You're welcome

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    Another approach using UDF

    'Put in text file as the forum rejected it directly

    How to use the UDF
    In K1 put this formula
    Please Login or Register  to view this content.
    Then drag down and to right

    Regards
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  8. #8
    Forum Contributor
    Join Date
    02-13-2016
    Location
    MUMBAI
    MS-Off Ver
    Microsoft 365
    Posts
    180

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    Perfect!! Thanks a lot Yasser!!

  9. #9
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: To find all combinations of numbers from list of numbers that adds upto a specified nu

    You're welcome. Gad it worked fine for you
    Thanks for the feedback and for the rep points

+ 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. Find most common numbers and number combinations
    By Raymundo46 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-17-2018, 04:25 PM
  2. Replies: 6
    Last Post: 01-25-2013, 01:33 PM
  3. List all combinations of 6/36 with unique 4 numbers
    By Martin888 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-13-2012, 10:48 AM
  4. Replies: 10
    Last Post: 01-24-2012, 08:58 PM
  5. Find all possible combinations of letters and numbers
    By grifter_1229 in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 09-15-2010, 08:09 AM
  6. [SOLVED] how do search a list of numbers to find what adds up to a large #
    By prissy in forum Excel General
    Replies: 0
    Last Post: 06-05-2006, 09:55 PM
  7. Find combinations of numbers to equal a value
    By jubu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 09:06 AM

Tags for this Thread

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