+ Reply to Thread
Results 1 to 6 of 6

Splitting up buyer amounts to match seller amounts

  1. #1
    Registered User
    Join Date
    08-04-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    Microsoft 365 for Business
    Posts
    2

    Lightbulb Splitting up buyer amounts to match seller amounts

    Hello all,

    I have a set of shareholders that have been given an equal amount of cash and stocks, but some want more cash and some want more stocks. There is a different number of buyers and sellers, but the total amount that is being bought/sold is the same.

    My predicament is that none of the buyer amounts match up or add up evenly into any of the seller amounts. My only solution is to split up the buyer amounts into different parts of each whole and then use combinations of all those parts to cleanly match every seller amount.

    That part in and of itself wouldn't be extremely difficult to just plug and chug, but there are constraints to how I can split up the buyer amounts, and how they can be distributed. A buyer cannot buy from more than 3 sellers, and a seller conversely cannot sell to more than 3 buyers. This means that I can only split the buyer amounts into a maximum of 3 parts, and I can only sum a maximum of 3 of those parts to equal each seller amount. All of these parts must also be integers greater than or equal to zero.

    I know this sounds like more of a logic puzzle than an excel question, but if anyone could point me in the right direction for where to start on this, it would be greatly appreciated.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,620

    Re: Splitting up buyer amounts to match seller amounts

    Seems that sorting ascending both groups and working top-bottom could (under reasonable similarity of distributions in both groups) give a quite good starting point

    so the smallest quantity seller sells for instance to two smallest quantity buyers. First gets all what he wanted, second buys only part of his requirement, so he buys the rest from the second smallest seller (or may be also from third smallest and so on.

    if the number of sellers and buyers is not too big, you could probably also use a Solver to find such way of splitting to minimize a number of transactions.

    See sample file - in first sheet there is "manual" solution with the abovementioned method, in next setup and one of results of solver (probably the goal and some other setup of solver model could be adjusted to get better result, unfortunately, I can't do it today
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Splitting up buyer amounts to match seller amounts

    Nice setup. I did a run and saw the "Incumbent" and the objective cell reached a stable value of 16 after a few seconds. so I changed the "Maximum Time without Improvement" on the Evolutionary tab from the default setting of 30 seconds to 5 second and got the same result as in the original solution.

    Alf

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,620

    Re: Splitting up buyer amounts to match seller amounts

    :-)
    Thnx Alf
    Let's wait for CaptainMorgan286 comments/reaction

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Splitting up buyer amounts to match seller amounts

    Let's wait for CaptainMorgan286 comments/reaction
    I'm sorry to say that first time posters with a solver question is a really bad combination if one except any feedback or comment unless the proposed / uploaded solution don't work. Even if the OP has up to 50 postings perhaps one in four will gives any feedback on a solver problem in my experience.

    Alf

  6. #6
    Registered User
    Join Date
    08-04-2021
    Location
    Chicago, Illinois
    MS-Off Ver
    Microsoft 365 for Business
    Posts
    2

    Re: Splitting up buyer amounts to match seller amounts

    Kaper,

    Sorry to get back to you so late on this, but I only just got my full actual list of buyers today, and was asking preemptively as this needs a quick turnaround. You and Alf have both had very helpful suggestions and I think I should be able to get to where I need to be with the combination of your suggestion to sort ascending both groups and using a solver for the rest that I cannot match up.

    Thanks for both of your help on this!

+ 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. Pivot and Chart Amounts don´t align in showing amounts
    By Ladohen in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-06-2020, 04:41 AM
  2. [SOLVED] HELP - This Macro works on small amounts of data but fails on large amounts
    By BookmanNLA in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-18-2015, 12:40 AM
  3. Replies: 2
    Last Post: 02-23-2014, 09:56 PM
  4. [SOLVED] Add Invoice Amounts and Paid Amounts based on user inputs.
    By s2jrchoi in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-18-2013, 01:49 PM
  5. Formula to take amounts from other sheet with no duplicate amounts
    By Xx7 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-06-2013, 04:34 PM
  6. Replies: 6
    Last Post: 03-22-2013, 04:54 PM
  7. Buyer Vs Seller Matching Formula
    By carl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2005, 03:10 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