Counting the number of column blocks with a specific condition

I have 2 main columns Employee number and sales agent number. Each employee can have 1 or more sales agents associated with them, and each of these sales agents under a specific employee has a certain bonus. Now I'm trying to calculate the fourth column of Final_bonus_split , while the values ​​in this column are the weight of bonuses of the corresponding agents for each employee number. For example, as follows:

Emp#    Sales_Agent#    Bonus_Split   Final_bonus_split
1000     123             10%          =10/(10+25+30) =  15%
1000     345             25%          =25/(10+25+30) =  38%
1000     987             30%          =30/(10+25+30) =  47%
2000     123             10%          =10/10         = 100%        
3000     345             50%          =50/(50+15)    =  77%
3000     647             15%          =15/(50+15)    =  23%
4000     634             40%          =40/40         = 100%

I am currently doing this using 2 helper columns, but wondered if this could be done using only one column.

+3
source share
1 answer

This is what you are looking for:

=C2/SumIf($A$2:$A$8;A2;$C$2:$C$8)
+2
source

All Articles