Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
liu liu is offline
external usenet poster
 
Posts: 17
Default find occurance of something from 2 creterion

If I have 2 columns like below:

A,2008
A,2007
C,2007
B,2008
C,2007
A,2008
A,2008
B,2008

I can use COUNTIF(A1:A8,A11) to find the total occurance of A, but how
can I add one moe creterion so I can get the result that it's A and
also 2008 (2nd column). So the answer should be 3 in the example
above.

Thanks for the help,

liu
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default find occurance of something from 2 creterion

In all Excel versions: =SUMPRODUCT(--(A1:A100="A"),--(B1:B100=2008))
Only in Excel 2007 : =SUMPRODUCT(--(A:A="A"),--(B:B=2008))
Only in Excel 2007: =COUNTIFS(A1:A100,"A",B1:B100,2008)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"liu" wrote in message
...
If I have 2 columns like below:

A,2008
A,2007
C,2007
B,2008
C,2007
A,2008
A,2008
B,2008

I can use COUNTIF(A1:A8,A11) to find the total occurance of A, but how
can I add one moe creterion so I can get the result that it's A and
also 2008 (2nd column). So the answer should be 3 in the example
above.

Thanks for the help,

liu



  #3   Report Post  
Posted to microsoft.public.excel.misc
liu liu is offline
external usenet poster
 
Posts: 17
Default find occurance of something from 2 creterion

On Feb 5, 1:33*pm, "Bernard Liengme"
wrote:
In all Excel versions: =SUMPRODUCT(--(A1:A100="A"),--(B1:B100=2008))
Only in Excel 2007 : =SUMPRODUCT(--(A:A="A"),--(B:B=2008))
Only in Excel 2007: =COUNTIFS(A1:A100,"A",B1:B100,2008)
best wishes


That works. Thank you so much for the hlep.
  #4   Report Post  
Posted to microsoft.public.excel.misc
liu liu is offline
external usenet poster
 
Posts: 17
Default find occurance of something from 2 creterion

On Feb 5, 2:02*pm, liu wrote:
On Feb 5, 1:33*pm, "Bernard Liengme"
wrote:

In all Excel versions: =SUMPRODUCT(--(A1:A100="A"),--(B1:B100=2008))
Only in Excel 2007 : =SUMPRODUCT(--(A:A="A"),--(B:B=2008))
Only in Excel 2007: =COUNTIFS(A1:A100,"A",B1:B100,2008)
best wishes


That works. Thank you so much for the hlep.


BTW, what does "--" mean in the function?

Thanks for the help.
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default find occurance of something from 2 creterion

http://www.mcgimpsey.com/excel/formulae/doubleneg.html
http://xldynamic.com/source/xld.SUMPRODUCT.html
--
David Biddulph

"liu" wrote in message
...

BTW, what does "--" mean in the function?

Thanks for the help.


On Feb 5, 2:02 pm, liu wrote:
On Feb 5, 1:33 pm, "Bernard Liengme"
wrote:

In all Excel versions: =SUMPRODUCT(--(A1:A100="A"),--(B1:B100=2008))
Only in Excel 2007 : =SUMPRODUCT(--(A:A="A"),--(B:B=2008))
Only in Excel 2007: =COUNTIFS(A1:A100,"A",B1:B100,2008)
best wishes


That works. Thank you so much for the hlep.





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
Find the next occurance Lou Excel Worksheet Functions 6 April 8th 08 04:37 AM
Find nth occurance of data yshridhar Excel Worksheet Functions 4 February 16th 08 05:19 PM
help to find a string for 4th occurance Eddy Stan Excel Worksheet Functions 1 September 22nd 07 11:13 PM
Macro to find last occurance hnyb1 Excel Discussion (Misc queries) 2 June 8th 07 04:40 PM
Find next occurance Jambruins Excel Discussion (Misc queries) 5 August 10th 06 04:48 PM


All times are GMT +1. The time now is 01:16 PM.

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"