+ Reply to Thread
Results 1 to 9 of 9

Find number of possible combinations in a list - vba

  1. #1
    Registered User
    Join Date
    09-14-2020
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    6

    Find number of possible combinations in a list - vba

    Good night people!

    I would like some help to develop some technique to find how many combinations I have within an existing list.

    Example:

    ORDER A - ITEM 1
    ORDER A - ITEM 4
    ORDER A - ITEM 8
    ORDER B - ITEM 4
    ORDER B - ITEM 1
    ORDER C - ITEM 4
    ORDER C - ITEM 8
    ORDER C - ITEM 5
    ORDER C - ITEM 3
    ORDER D - ITEM 8
    ORDER D - ITEM 4

    My problem is trying to find out for example how many orders I have with items 4 and 8 in the same order and so on. An analysis of the mix of items on each order, I have tried everything here but I have not yet succeeded ... The problem too and that there would not always be the sequence of the same items ... In my head it would practically look like:

    ITEM 4 AND ITEM 8 - 3 ORDERS
    ITEM 1 AND ITEM 4 - 2 ORDERS
    ITEM 4, ITEM 8 AND ITEM 1 - 1 ORDER

    Adding that I would need to find subcombination within a combination as well. I am attaching my base to facilitate

    Obs. I have an average of 18000 different items ...

    Forgive my English, I still haven't found a solution in BR.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Find number of possible combinations in a list - vba

    Try entering the following formula in Col C and copying down: Note, it will take time to process:

    Please Login or Register  to view this content.
    I found 660 items were duplicate up to 6x in your data

  3. #3
    Registered User
    Join Date
    09-14-2020
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    6

    Re: Find number of possible combinations in a list - vba

    Okay, but how can that show me the combinations?

    Sorry but I didn't understand it very well

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Find number of possible combinations in a list - vba

    I focused on providing duplicates, I misread the original question.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Find number of possible combinations in a list - vba

    Hi

    It looks like a case of not being able to see the wood for the trees. You have to much data so you need to simplify things.

    I am working on a couple of ideas for you.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Find number of possible combinations in a list - vba

    Are you limited to Excel only? "Market basket analysis" is a common data mining task, and there are many pre-programmed utilities available. At one time (Excel 2010, I believe) Excel had a "shopping basket analysis" tool (through Power BI, I think: https://docs.microsoft.com/en-us/pre...ql-server-2017 and https://techcommunity.microsoft.com/...016/m-p/130589 ), but MSFT did not keep the tool functional in later versions of Excel. Power-BI appears to still be able to do market basket analysis (https://finance-bi.com/power-bi-basket-analysis/ ), just not necessarily integrated with Excel. Of course, if you are allowed to look beyond MSFT products, there are many data mining tools that can do market basket analysis (your favorite internet search engine should be able to help you find them).

    If you must program your own algorithm in Excel, perhaps this tutorial will be useful: https://people.revoledu.com/kardi/tu...sket/index.htm
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Registered User
    Join Date
    09-14-2020
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    6

    Re: Find number of possible combinations in a list - vba

    I did not know this technique, I am trying to understand here because it does not contain many tutorials in Portuguese .. But I know a little bit of Power bi, I will try.

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Find number of possible combinations in a list - vba

    Try running this macro to reduce your data.



    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    09-14-2020
    Location
    Brazil
    MS-Off Ver
    365
    Posts
    6

    Re: Find number of possible combinations in a list - vba

    Okay, in theory I have all the combinations of items on that list, but how do I find the number of orders on each one?

    And in the case this combination should show for example about 3 items:

    ITEM 4, ITEM 6, ITEM 7

    ITEM 4, ITEM 6

    ITEM 4, ITEM 7

    ITEM 7, ITEM 6

    Right?

+ 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 number of possible combinations in a list
    By Vilela in forum Excel General
    Replies: 3
    Last Post: 09-14-2020, 09:54 PM
  2. [SOLVED] To find all combinations of numbers from list of numbers that adds upto a specified number
    By Vivek2705 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-07-2019, 06:33 AM
  3. [SOLVED] Geting highest number value from list with values which are text/number combinations
    By igormigor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2016, 10:48 AM
  4. Replies: 1
    Last Post: 06-04-2014, 05:40 PM
  5. find all combinations of cells that add up to certain number
    By AD in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-18-2005, 09:35 AM
  6. [SOLVED] find all combinations of cells that add up to certain number
    By AD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-17-2005, 03:55 PM
  7. [SOLVED] find all combinations of cells that add up to certain number
    By AD in forum Excel General
    Replies: 1
    Last Post: 11-17-2005, 03:40 PM

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