Carlow52,
Thanks for the response. Understand your concerns about the excel attachment so I'll do my best to explain here. FWIW I have no scripts in the attached file, so if you did try to open and got prompted to enable any macros then something fishy is going on.
On to your questions:
1) We are selling in all cases, though I don't think it would matter if we were buying, as all I'm looking to do is allocate a block of shares at specific prices to a group of clients so that everyone gets the same price and their deserved percentage of the total executed order.
2) Here's my attempt at recreating the sheet:
Code:
Client Name: Black Blue White Totals
Order Qty: 18,008 12,540 5,800 36,348
% of Total Order: 49.5433% 34.4998% 15.9569% 100%
Shares to be Allocated: 793 552 255 1,600
Quantity Price
300 25.89 148 103 47 298
300 25.895 148 103 47 298
100 26.365 49 34 15 98
200 26.38 99 68 31 198
200 26.39 99 68 31 198
500 26.4 247 172 79 498
-------------------------------------------------------------------------------
Total Sold 1,600 790 548 250 1,588
Average Price 26.2038 $26.2039 $26.2033 $26.2034 $26.2036
Does that make it any clearer? The 'Shares to be Allocated' row totals need to match the 'Total Sold' row for each client (which my macro does), and the 'Quantity' column on the left needs to match the 'Totals' column on the right (which my macro can also do). Problem is that all of the shares are assigned, but in the wrong places, so the Average Prices for each client don't match the Average Price for the lot ($26.2038)
Thanks for the time on this... please let me know if you need more info.
-Mike