Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 160
Default COUNTIF with 2 variables. HOW???

Here is what I am trying to do. In a cell I want it to look at a range of
other cells with the "COUNTIF" formula. I want to be able to say to a
particular cell, for example:

Look at the range of cells A1:Z1. Count them if the value is 0 and <2.5.

For some reason I just can't seem to get it to work or to get Excel to tell
me what I'm doing wrong!!! HELP!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default COUNTIF with 2 variables. HOW???

Look at the range of cells A1:Z1. Count them if the value is 0 and <2.5.

Based on the *literal* interpretation:

=COUNTIF(A1:Z1,"0")-COUNTIF(A1:AZ1,"2.49999999999")

This will count cells greater than 0 and less than 2.5. This *excludes* 0
and 2.5. If you meant the count to be *inclusive*:

=COUNTIF(A1:Z1,"=0")-COUNTIF(A1:AZ1,"2.5")

This *includes* 0 and 2.5.

--
Biff
Microsoft Excel MVP


"Patrick" wrote in message
...
Here is what I am trying to do. In a cell I want it to look at a range of
other cells with the "COUNTIF" formula. I want to be able to say to a
particular cell, for example:

Look at the range of cells A1:Z1. Count them if the value is 0 and <2.5.

For some reason I just can't seem to get it to work or to get Excel to
tell
me what I'm doing wrong!!! HELP!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 160
Default COUNTIF with 2 variables. HOW???

BTW, here is the formula I have tried using and Excel keeps telling me I am
missing a parenthesis. Just won't tell me WHERE it is missing!

=COUNTIF(AND(Attendance!D3:S30,Attendance!D3:S3<2 .5)

"Patrick" wrote:

Here is what I am trying to do. In a cell I want it to look at a range of
other cells with the "COUNTIF" formula. I want to be able to say to a
particular cell, for example:

Look at the range of cells A1:Z1. Count them if the value is 0 and <2.5.

For some reason I just can't seem to get it to work or to get Excel to tell
me what I'm doing wrong!!! HELP!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 160
Default COUNTIF with 2 variables. HOW???

Thanks, and please pardon my confusion (ignorance). When I look at your
first suggestion it looks like you are saying to count anything greater than
0, which I do want it to do, but I don't want it to count anything GREATER
than 2.49999999 and that is how I am reading your formula. I tried typing
your formula in but changed the to <. Still no luck. Can you see any
error in the formula I attached before your post?

"T. Valko" wrote:

Look at the range of cells A1:Z1. Count them if the value is 0 and <2.5.


Based on the *literal* interpretation:

=COUNTIF(A1:Z1,"0")-COUNTIF(A1:AZ1,"2.49999999999")

This will count cells greater than 0 and less than 2.5. This *excludes* 0
and 2.5. If you meant the count to be *inclusive*:

=COUNTIF(A1:Z1,"=0")-COUNTIF(A1:AZ1,"2.5")

This *includes* 0 and 2.5.

--
Biff
Microsoft Excel MVP


"Patrick" wrote in message
...
Here is what I am trying to do. In a cell I want it to look at a range of
other cells with the "COUNTIF" formula. I want to be able to say to a
particular cell, for example:

Look at the range of cells A1:Z1. Count them if the value is 0 and <2.5.

For some reason I just can't seem to get it to work or to get Excel to
tell
me what I'm doing wrong!!! HELP!




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default COUNTIF with 2 variables. HOW???

Trust me!

The logic of the formula I suggested does exactly what you asked for. I
understand that just looking at it, it does not appear to be intuitive but
it does what you want. Here's a different version that might be more
visually appealing:

=SUMPRODUCT(--(A1:Z10),--(A1:Z1<2.5))

This returns the same result as the COUNTIF version. The COUNTIF version is
more efficient than the SUMPRODUCT version.

If I would have orginally posted the SUMPRODUCT version someone else would
have posted the COUNTIF version!

--
Biff
Microsoft Excel MVP


"Patrick" wrote in message
...
Thanks, and please pardon my confusion (ignorance). When I look at your
first suggestion it looks like you are saying to count anything greater
than
0, which I do want it to do, but I don't want it to count anything GREATER
than 2.49999999 and that is how I am reading your formula. I tried typing
your formula in but changed the to <. Still no luck. Can you see any
error in the formula I attached before your post?

"T. Valko" wrote:

Look at the range of cells A1:Z1. Count them if the value is 0 and
<2.5.


Based on the *literal* interpretation:

=COUNTIF(A1:Z1,"0")-COUNTIF(A1:AZ1,"2.49999999999")

This will count cells greater than 0 and less than 2.5. This *excludes* 0
and 2.5. If you meant the count to be *inclusive*:

=COUNTIF(A1:Z1,"=0")-COUNTIF(A1:AZ1,"2.5")

This *includes* 0 and 2.5.

--
Biff
Microsoft Excel MVP


"Patrick" wrote in message
...
Here is what I am trying to do. In a cell I want it to look at a range
of
other cells with the "COUNTIF" formula. I want to be able to say to a
particular cell, for example:

Look at the range of cells A1:Z1. Count them if the value is 0 and
<2.5.

For some reason I just can't seem to get it to work or to get Excel to
tell
me what I'm doing wrong!!! HELP!






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 formula with several variables in 1 column NitaMax Excel Discussion (Misc queries) 3 February 8th 07 02:35 AM
countif two variables in two different columns Greg Diamond Excel Worksheet Functions 2 May 25th 05 07:58 PM
Countif function with variables SMANDA Excel Worksheet Functions 0 February 7th 05 10:46 PM
another thought on COUNTIF 2 VARIABLES ?? Alan Excel Worksheet Functions 1 November 27th 04 03:25 AM
COUNTIF ON 2 VARIABLES ?? Alan Excel Worksheet Functions 4 November 26th 04 08:10 PM


All times are GMT +1. The time now is 03:28 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"