+ Reply to Thread
Results 1 to 11 of 11

Most frequent items bought together

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    England
    Posts
    24

    Most frequent items bought together

    Hi All,

    I have a database of sales transactions and products bought within those transactions. A transaction could contain between 1 and 20 products. I am trying to find out what the most frequently bought items are, and groups of items.

    This kind of analysis is called market basket analysis and I am trying to reconstruct this in excel.

    I have attached a sample spreadsheet of the database and what I would like the output to be. The database could contain around 10,000 products within 2,000 transactions so would need a macro to be most efficient.

    Hope someone can assist.

    Many thanks

    Mike
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Most frequent items bought together

    you can take the cells(r2,10) and cells(r2,11) entries I added them as checkups

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-07-2008
    Location
    England
    Posts
    24

    Re: Most frequent items bought together

    Hi

    Thanks for the code.

    How can this code be adjusted if the items had longer names and weren't single letters i.e the item name could be "apple ipad 64gb" for example.

    Thanks

    Mike

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Most frequent items bought together

    I thought you might ask that .. please send a couple of sample item codes and I'll adjust the code accordingly.

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

    Re: Most frequent items bought together

    A quick internet search for "market basket analysis" found this page (with sample spreadsheet) that may be instructive: http://people.revoledu.com/kardi/tut...sket/index.htm
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Most frequent items bought together

    try this new code
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-07-2008
    Location
    England
    Posts
    24

    Re: Most frequent items bought together

    Hi rcm,

    This code is fantastic! Just what I am after.

    However.....is their a way that the code could be amended to only return combinations of products which appear in the database more than once, and only show bundles of up to 6 items? The reason why I am asking is because of the amount of data which I have the code looking at (c. 50,000 lines) which is causing excel to stop working as the system doesn't have enough resources to process.

    Many thanks

    Mike
    Last edited by MJB123; 09-27-2013 at 11:13 AM.

  8. #8
    Registered User
    Join Date
    11-07-2008
    Location
    England
    Posts
    24

    Re: Most frequent items bought together

    Hi Mr Shorty,

    Thanks. Already downloaded that spreadsheet but didn't think it was the right method to use for the vast amount of data I am working with.

    Regards

    Mike

  9. #9
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Most frequent items bought together

    Dear Mike:

    The process does not know how many times an specific combination will have until the end. Let me think about how to exclude combinations larger than 6 or if they have only hit.

  10. #10
    Registered User
    Join Date
    11-07-2008
    Location
    England
    Posts
    24

    Re: Most frequent items bought together

    Ok thankyou. I appreciate you looking at it for me

    Mike

  11. #11
    Registered User
    Join Date
    05-05-2015
    Location
    Mumbai
    MS-Off Ver
    2011
    Posts
    1

    Re: Most frequent items bought together

    Quote Originally Posted by MrShorty View Post
    A quick internet search for "market basket analysis" found this page (with sample spreadsheet) that may be instructive: http://people.revoledu.com/kardi/tut...sket/index.htm
    Mr Shorty

    Thanks for sharing the link. I was going throught the tutorial and wondered how can I create the 2D matrix that is being talked about here. I am sure that there is a standard way to create such an array in excel. Would somebody mind sharing the approach with me.

    For reference I am attaching the excel sheet which has the illustration of what I want.

    Thanks!
    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)

Similar Threads

  1. Create a list of bought-out items for various assemblies
    By aimeelou2006 in forum Excel General
    Replies: 2
    Last Post: 04-02-2013, 05:43 PM
  2. [SOLVED] Pricing Lookup based on qty bought
    By [email protected] in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2012, 03:01 PM
  3. Replies: 3
    Last Post: 03-20-2012, 09:53 PM
  4. total of different items bought per month
    By yeats48 in forum Excel General
    Replies: 1
    Last Post: 03-11-2008, 08:56 AM
  5. Replies: 1
    Last Post: 12-24-2005, 07:15 AM

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