Weighted Average Price

C

carl

I have this data:

Buy/Sell Price Qauntity

Buy 10 25
Buy 15 10
Sell 5 5

I am trying to calculate my "position" (Buy's minus
Sell's) and average price:

Position Average Price
+ 20 ??

Can Excel Do this for me ?

Thank you in advance
 
N

NH

assuming col A contains Sell or Buy, col B contains Quantity and Col c
contains Price

The closing position of Quantity =
SUMIF(A1:A3,"Buy",B1:B3)-SUMIF(A1:A3,"Sell",B1:B3)
Average Price

=(SUMPRODUCT(--(A1:A3="Buy")*(B1:B3)*(C1:C3))-SUMPRODUCT(--(A1:A3="Sell"),--
(B1:B3),--(C1:C3))/SUMIF(A1:A3,"Buy",B1:B3)-SUMIF(A1:A3,"Sell",B1:B3)
 
C

carl

hi. when i put this formula in it told me that the
parentheses were misplaced/missing. i tried the excel
suggestion but did not get the correct average price.

am i doing something wrong ?
 
D

Domenic

Assuming that your data starts in the second row...

Average Price:

=(SUMPRODUCT((A2:A4="Buy")*(B2:B4)*(C2:C4))-SUMPRODUCT((A2:A4="Sell")*(B2
:B4)*(C2:C4)))/(SUMIF(A2:A4,"Buy",C2:C4)-SUMIF(A2:A4,"Sell",C2:C4))

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top