r1998
Board Regular
- Joined
- Sep 9, 2018
- Messages
- 106
Dear friends and respected seniors 
I have this data starting from cell a1 to d8
I am comparing the contents of column A and summing up similar data from column B
a1 and a2 has A, hence 2+3 = 5,
a3, a4 and a5 have B, hence 6+4+2 = 12,
a6, a7 and a8 have C, hence 1+(-6)+2 = -3, and so on
in c1 I have used this formula and dragged down till c8
the answers are correct, but that is not the output that i want 
In column D, i have entered the required output manually
Can anyone please kindly help me with this problem
Awaiting your replies.
Thank you.

I have this data starting from cell a1 to d8

Code:
A 2 5 5
A 3 5 12
B 6 12 -3
B 4 12
B 2 12
C 1 -3
C -6 -3
C 2 -3
a1 and a2 has A, hence 2+3 = 5,
a3, a4 and a5 have B, hence 6+4+2 = 12,
a6, a7 and a8 have C, hence 1+(-6)+2 = -3, and so on
in c1 I have used this formula and dragged down till c8
Code:
=SUMIF($A$1:$A$8,A1,$B$1:$B$8)

In column D, i have entered the required output manually
Can anyone please kindly help me with this problem

Awaiting your replies.
Thank you.