In the table below I want to get the average score for items that meet the following criteria. The combined count of A and B is >2 per each ID. If so then average the counts for products A and B if present in that ID.
For this table I want to see the average score of 20.
2 A 5
2 B 5
3 B 50
ID Product Score Count
1 A 10 1
1 B 10 1
1 C 5 2
2 A 5 2
2 B 5 1
2 D 10 1
3 C 10 1
3 B 50 10
3 F 10 5
4 A 5 2
For this table I want to see the average score of 20.
2 A 5
2 B 5
3 B 50
ID Product Score Count
1 A 10 1
1 B 10 1
1 C 5 2
2 A 5 2
2 B 5 1
2 D 10 1
3 C 10 1
3 B 50 10
3 F 10 5
4 A 5 2