#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 90
Default COUNTIF Function

Hi, I'm having a few problems with the COUNTIF function. This is what I'm
looking for.

Range is A40:A70. This contains numbers between 0 and 21.

Then I have columns B,C,D
In columnB I would like to have COUNTIF(A40:A70, odd number) (So count all
odd number's in the range except for 0)
In columnC I would like to have COUNTIF(A40:A70, 12 AND <21) (So count all
numbers between 12 and 21)
In columnD I would like to have COUNTIF(A40:A70, 1,4,7,13,19) (So count all
numbers I've requested)

Hope this makes sense. I'm sure it's something simple, but I can't figure
it out.
Thanks again!
Matt

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default COUNTIF Function

One way:

B: =SUMPRODUCT(--(MOD(A40:A70,2)=1))

C: =COUNTIF(A40:A70, "12") - COUNTIF(A40:A70,"=21")

D: =SUM(COUNTIF(A40:A70,{1,4,7,13,19}))

(So count all odd number's in the range except for 0)


Um... 0 isn't odd...

In article ,
mpenkala wrote:

Hi, I'm having a few problems with the COUNTIF function. This is what I'm
looking for.

Range is A40:A70. This contains numbers between 0 and 21.

Then I have columns B,C,D
In columnB I would like to have COUNTIF(A40:A70, odd number) (So count all
odd number's in the range except for 0)
In columnC I would like to have COUNTIF(A40:A70, 12 AND <21) (So count all
numbers between 12 and 21)
In columnD I would like to have COUNTIF(A40:A70, 1,4,7,13,19) (So count all
numbers I've requested)

Hope this makes sense. I'm sure it's something simple, but I can't figure
it out.
Thanks again!
Matt

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 90
Default COUNTIF Function

Hi JE,

Thanks for the help - everything works great. As for the 0 not being odd...
sorry, my bad. I just asked for odd, but I was looking for odd and even
(hence he asking about 0). But I found the answer to that on another post.

Thanks again, this site rocks!
Matt


"JE McGimpsey" wrote:

One way:

B: =SUMPRODUCT(--(MOD(A40:A70,2)=1))

C: =COUNTIF(A40:A70, "12") - COUNTIF(A40:A70,"=21")

D: =SUM(COUNTIF(A40:A70,{1,4,7,13,19}))

(So count all odd number's in the range except for 0)


Um... 0 isn't odd...

In article ,
mpenkala wrote:

Hi, I'm having a few problems with the COUNTIF function. This is what I'm
looking for.

Range is A40:A70. This contains numbers between 0 and 21.

Then I have columns B,C,D
In columnB I would like to have COUNTIF(A40:A70, odd number) (So count all
odd number's in the range except for 0)
In columnC I would like to have COUNTIF(A40:A70, 12 AND <21) (So count all
numbers between 12 and 21)
In columnD I would like to have COUNTIF(A40:A70, 1,4,7,13,19) (So count all
numbers I've requested)

Hope this makes sense. I'm sure it's something simple, but I can't figure
it out.
Thanks again!
Matt


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
please help how to combine IF function with Countif function Dinesh Excel Worksheet Functions 6 March 30th 06 08:28 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
Embed a countif function in subtotal function? Stuck at work Excel Worksheet Functions 1 February 14th 06 03:19 AM
countif function andrewm Excel Worksheet Functions 1 July 12th 05 11:44 AM
COUNTIF Function Meredith Excel Discussion (Misc queries) 6 March 14th 05 07:46 PM


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

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"