Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Sum If function with 2 criteria

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Sum If function with 2 criteria

thanks a million, it worked with me but i have another problem
using the same example, this time i need to COUNT # of selling transactions
alone which means that i need to count based on 2 criteria "HRHO" and "Sell",
then "HRHO" and "Buy"
Database:
Stock ticker Quantity Buy/Sell
HRHO 1000 Buy
ESRS 500 Buy
HRHO 500 Sell

Inquiry: Ticker # of Transactions"Buy" # of
transactions "Sell"
HRHO ???
???
Kind regards,

Khaled




"T. Valko" wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Sum If function with 2 criteria

To *COUNT* buy/sell:

=SUMPRODUCT(--(A2:A4="HRHO"),--(C2:C4="BUY"))
=SUMPRODUCT(--(A2:A4="HRHO"),--(C2:C4="SELL"))

Biff

"khaled shaheen" wrote in message
...
thanks a million, it worked with me but i have another problem
using the same example, this time i need to COUNT # of selling
transactions
alone which means that i need to count based on 2 criteria "HRHO" and
"Sell",
then "HRHO" and "Buy"
Database:
Stock ticker Quantity Buy/Sell
HRHO 1000 Buy
ESRS 500 Buy
HRHO 500 Sell

Inquiry: Ticker # of Transactions"Buy" # of
transactions "Sell"
HRHO ???
???
Kind regards,

Khaled




"T. Valko" wrote:

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






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default Sum If function with 2 criteria



"khaled shaheen" wrote:

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

Make new colum with with the ticker and the buy/sell with and function
like this : HRHO&buy (you can name it "ticket&kind") an hide it
use this colum in the sumif function istead of the ticket colum with the
criteria "hrho"&"buy"
I hope it helps


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Criteria for datbase function in one row? Thomas R. Glass Excel Worksheet Functions 3 October 25th 06 02:14 PM
criteria function using max scott Excel Worksheet Functions 5 September 19th 06 02:46 AM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
include criteria to 'rank based array function' TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 September 2nd 06 01:15 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM


All times are GMT +1. The time now is 07:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"