+ Reply to Thread
Results 1 to 11 of 11

How to find the most common data combinations

  1. #1
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    91

    How to find the most common data combinations

    I have a list of customers along with their purchases. I would like to see what are the most popular purchase combinations that customer make.
    For example in this scenario, the most common is Apple and Orange with 3 customers ordering both.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,910

    Re: How to find the most common data combinations

    You need to mock up an example of what you want. Just giving us the raw data is not enough.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    91

    Re: How to find the most common data combinations

    Of course, sorry about that. See attached. I'm interested in anything that shows up more than once really, in order of most common.
    Attached Files Attached Files
    Last edited by AliGW; 06-08-2022 at 08:35 AM. Reason: PLEASE don't quote unnecessarily!

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

    Re: How to find the most common data combinations

    That sounds like "market basket analysis". I know we've had previous conversations here over the years for market basket analysis type problems, and it seems like most of them have been some form of "find an outside utility/app/add-in that does it." If you are not required to program your own MBA algorithm from scratch, then that is probably the easiest. I even seem to recall seeing (for a past version of Excel 2013 I think) something like an optional Power-BI menu/ribbon that had a built in MBA tool integrated into Excel. If you have access to Power BI (or other third party tool), see how to use it to perform the analysis.

    I'm not familiar with the algorithms behind MBA, so I would not be able to program it into the spreadsheet. I expect that, if it is necessary to program from scratch and you help us understand the algorithm, we should be able to help with the programming.

    If it helps, I put "market basket analysis Excel" into my favorite search engine and this was the first of many hits: https://www.data-mania.com/blog/mark...ysis-in-excel/ Certainly not the only one, nor do I suggest it is the best tutorial, just the first in my results list. There are plenty of others if you want to search for them.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: How to find the most common data combinations

    With possible combinations listed in D1:M2 and Customer Name in C3:C7,
    D3=QUOTIENT(COUNTIFS(A2:A14,C3#,B2:B14,D1:M1)+COUNTIFS(A2:A14,C3#,B2:B14,D2:M2),2)

    How to find the most common data combinations.png

  6. #6
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    91

    Re: How to find the most common data combinations

    This looks great, however it looks like you manually wrote the different possible combinations - D1:M2. Is that right? In the real data that I want to apply this to, there are 56 different products, rather than the 5 in this spreadsheet, so that wouldn't really be feasible.
    Last edited by AliGW; 06-10-2022 at 05:40 AM. Reason: PLEASE don't quote unnecessarily!

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: How to find the most common data combinations

    A VBA-based solution using a "matrix" of similar concept as Josephteh formula solution.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 06-09-2022 at 07:25 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  8. #8
    Registered User
    Join Date
    04-16-2021
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    91

    Re: How to find the most common data combinations

    Thanks. I've never used a VBA, so not sure how to apply this to my main spreadsheet.
    Last edited by AliGW; 06-10-2022 at 05:40 AM. Reason: PLEASE don't quote unnecessarily!

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: How to find the most common data combinations

    First, there is no need to re-post (quote) the code: it is just "clutter" and wastes resource.

    Second, post a fie which represents your actual file format [and anonymise any data]. The code can then be adjusted as needed.
    Last edited by JohnTopley; 06-10-2022 at 05:43 AM.

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How to find the most common data combinations

    Please try

    With Lambda

    Please Login or Register  to view this content.

    MS365 Insider
    Please Login or Register  to view this content.
    Last edited by Bo_Ry; 06-10-2022 at 09:00 AM. Reason: corrected dynamic rows

  11. #11
    Forum Contributor
    Join Date
    11-21-2013
    Location
    zimbabwe
    MS-Off Ver
    Excel 2003
    Posts
    124

    Re: How to find the most common data combinations

    Suppose that C2:C6 is List of fruits you have
    Fruits
    Apple
    Orange
    Grapefruit
    Banana
    Grapes
    Formula to count the most common number of purchasing any both of fruits
    Please Login or Register  to view this content.
    Confirmed with CTRL+SHIFT+ENTER
    Good luck
    Last edited by soledad; 06-15-2022 at 10:41 PM.

+ 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. Calculate most common combinations
    By michael.p in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-08-2016, 02:16 AM
  3. [SOLVED] Combining two lists of names and all combinations based on a separate common value
    By Speshul in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2015, 12:31 PM
  4. How to Find all combinations of text data in excel
    By agressett in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2014, 02:44 PM
  5. Replies: 4
    Last Post: 08-22-2011, 07:52 AM
  6. Editing code to show common four-word combinations in a column
    By Glayva in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-07-2011, 09:06 AM
  7. Find Specific Combinations of Data
    By jxel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-04-2010, 02:28 PM

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