Using your sample workbook, this formula, copied across, returns the extended values
D13: =SUMPRODUCT(($B$3:$B$8=$B13)*$C$3:$C$8*D3:D8)
These are the results:
B
C
D
E
F
G
H
I
J
12
DRESSES
Units
80
0
0
80
40
0
0
13
DRESSES
Value - (Units x SP)
34600
0
0
39600
18800
0
0
Is that something you can work with?