pedroalegria
New Member
- Joined
- Mar 17, 2023
- Messages
- 2
- Office Version
- 2019
- Platform
- Windows
I need to distribute quantity by order price, that is, I have a table where I have hundreds of products in the lines and then I have customer orders in the columns (quantity and price for each order).
I've already managed to identify and order the prices from highest to lowest, and now I need to distribute the available stock among the orders, always starting at the highest price.
I've already managed to identify and order the prices from highest to lowest, and now I need to distribute the available stock among the orders, always starting at the highest price.
Product | Available Stock | Total Quantity | Order_1 | Order_2 | Order_3 | |||
Quantity | Price | Quantity | Price | Quantity | Price | |||
A | 920 | 1077 | 100 | 3,00 € | 432 | 1,00 € | 545 | 4,00 € |
B | 150 | 183 | 43 | 12,00 € | 65 | 43,00 € | 75 | 15,00 € |
C | 100 | 206 | 43 | 43,00 € | 76 | 21,00 € | 87 | 54,00 € |
D | 200 | 652 | 243 | 87,00 € | 111 | 43,00 € | 298 | 21,00 € |
What I Need: | ||||||||
Product | Available Stock | Total Quantity | Order_1 | Order_2 | Order_3 | |||
Quantity | Price | Quantity | Price | Quantity | Price | |||
A | 920 | 1077 | 100 | 275 | 545 | |||
B | 150 | 183 | 10 | 65 | 75 | |||
C | 100 | 206 | 13 | 87 | ||||
D | 432 | 114 | 200 |