I have some data in excel with the following structure:
Product
Project
Sales
700
001
1000
700
001
2000
700
002
3000
700
001
1500
700
004
3000
700
002
4000
700
004
1000
700
002
2000
When I select project 001, the project 004 must be added to project 001 according to a percentage (60%), while the rest must be added to project 002 (40%). For example:
If I select project 001, I should add: 1000 + 2000 + 1500 + (3000 * 0.6) + (1000 * 0.6) = 6.900
If I select project 002, I should add: 3000+ (3000 * 0.4) +4000+ (1000 * 0.4) + 2000 = 10,600