#1   Report Post  
Posted to microsoft.public.excel.misc
tom tom is offline
external usenet poster
 
Posts: 570
Default Countif and

I have two columns (A:B) that I am trying to do a countif statement for, but
can seem to figure it out. In column A I have "A's" and "I''s" and in
column B I have numbers 1 - 198.

Example
A B
a 150
i 120
a 30
i 150

Result
a i
=150 1 1
=120 1
=90

<90 1

TFTH...


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Countif and

Use SUMPRODUCT(). Here is an example for col A being "a" and col B being <90

=SUMPRODUCT(--(A1:A100="a"),--(B1:B100<90))

The other cases are simple adaptations of this.
--
Gary''s Student - gsnu200800


"tom" wrote:

I have two columns (A:B) that I am trying to do a countif statement for, but
can seem to figure it out. In column A I have "A's" and "I''s" and in
column B I have numbers 1 - 198.

Example
A B
a 150
i 120
a 30
i 150

Result
a i
=150 1 1
=120 1
=90

<90 1

TFTH...


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Countif and

Hi Tom

in D1 enter A, in E1 enter I
In C2 enter 150, C3 120, C$ 90, C5 90
In cell D2
=SUMPRODUCT(($A$1:$A$100=D$1)*($B$1:$B$100=$C2)*
($B$1:$B$100<""))
copy to E2
In cell D3
=SUMPRODUCT(($A$1:$A$100=D$1)*($B$1:$B$100=$C3)*
($B$1:$B$100<$C2)*($B$1:$B$100<""))
copy to E3 and copy D3:E3 to D4

In cell D5
=SUMPRODUCT(($A$1:$A$100=D$1)*($B$1:$B$100<$C5)*
($B$1:$B$100<""))
copy to E5

The formulae do not need to be wrapped onto 2 lines, I just did that to
;prevent the newsreader breaking in an awkward place.
--
Regards
Roger Govier

"tom" wrote in message
...
I have two columns (A:B) that I am trying to do a countif statement for,
but
can seem to figure it out. In column A I have "A's" and "I''s" and in
column B I have numbers 1 - 198.

Example
A B
a 150
i 120
a 30
i 150

Result
a i
=150 1 1
=120 1
=90

<90 1

TFTH...


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
CountIf carl Excel Worksheet Functions 2 September 21st 07 10:40 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


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

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

About Us

"It's about Microsoft Excel"