Sum If function with 2 criteria
Try this:
=SUMPRODUCT(--(A2:A4="HRHO"),--(C2:C4="BUY"),B2:B4)
Better to use cells to hold the criteria:
..............E..............F.........G
1.......Ticker........Buy......Sell
2.......HRHO........................
Entered in F2 and copied across then down as needed:
=SUMPRODUCT(--($A$2:$A$4=$E2),--($C$2:$C$4=F$1),$B$2:$B$4)
Biff
"khaled shaheen" wrote in message
...
Hi all,
First here below my example in order to be understood easily
Database:
Stock ticker Quantity Buy/Sell
HRHO 1000 Buy
ESRS 500 Buy
HRHO 500 Sell
Inquiry:
Ticker Total Bought Total Sold
HRHO ??? ???
I want to know how to get the total quantity sold for HRHO alone, by using
Sumif function it gives me total quatity (bought + sold) for HRHO
together.
Appreciate your support,
Khaled
|