ExcelBanter (https://www.excelbanter.com/)

 owj1993 March 8th 13 11:39 AM

Linking data between sheets with limits on quantity

Hello

The Scenario:
the company I work for have four main customers who near the end of every month will e-mail a list of the stock they want, the maximum quantity they can accept and the price they can afford to pay per unit.

Say for example we have 28 units of one item and the customers have emailed us to saying this

customer 1 -- 10 units at £54.10/ea
customer 2 -- 100 units at £53.90/ea
customer 3 -- 15 units at £54.50/ea
customer 4-- 50 units at £52.50/ea

Now currently in the excel template I am trying to create I have a space for the total number of stock we have (in the example 28) and a two columns for each customer, one saying the price and another with the quantity. This could be a master style sheet and 4 more sheets each one with a blank invoice on it waiting for it to be populated by the stock they can pay the most for.

Obviously, as a company we want to sell as many as we can for the highest price so we would sell 15 to customer 3 for £54.50/ea, 10 to customer 1 for £54.10/ea and the remaining three to customer 2 for £53.90/ea

So my question is, how would I be able to make excel to rank the data so that the customer who is prepared to pay the most gets up to their maximum quantity and the rest (upto the max) goes to the other customers