I'm looking for a way to sum the results of values multiplied by values with a similar key.

Below a simplified Example:

sheet 1:

A B

1 P1 10

2 P2 15

3 P3 5

4 P4 1

5 P5 20

6 P6 10

sheet 2:

A B

1 -

2 P1 1.50

3 P2 2.00

4 P6 0.50

5 P3 1.00

6 P4 2.50

7 P5 3.00

Result should be: 117.5 (B1*E2+B2*E3+B3*E5+B4*E6+B5*E7+B6*E4)

Hope this is clear enough and you can help