Hi, I want to perform a certain operation on rows of a dataset in the following way: I have a dataset lIke this one:
 
Name      ID      code       value
A              1       x1           2
A              3       x2           22
A              5       x3           31
B              1       x1           4
B              3       x2           23
B              5       x3           1
C              1       x1           4
C              3       x2           43
C              5       x3           2
 
What I need is, add the first two rows and  then, the result multiply by the third one but for each name group. In this case a dataset like this one
 
Name    Result
A            774
B            27
C            94
 
In the real dataset there are 56 name groups but it is not a fixed number, it can vary depending on some previous calculations. Anyone knows how can I do this? Thanks in advance.