#1   Report Post  
Posted to microsoft.public.excel.misc
Amy Amy is offline
external usenet poster
 
Posts: 165
Default if then statement

I would like to count the number of cells in a range that has a number in it
that is greather than 4999 but less than 9999 - any ideas
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default if then statement

Hi Amy

One way, with data in column A, enter in B1
=COUNTIF(A:A,"4999")-COUNTIF(A:A,"9999")

--

Regards
Roger Govier

"Amy" wrote in message
...
I would like to count the number of cells in a range that has a number in
it
that is greather than 4999 but less than 9999 - any ideas


  #3   Report Post  
Posted to microsoft.public.excel.misc
Amy Amy is offline
external usenet poster
 
Posts: 165
Default if then statement

Roger,
Thanks for the advice, what that equation is doing is counting the numbers
less than 4999 and subtracting the numbers that are greater than 9999

"Roger Govier" wrote:

Hi Amy

One way, with data in column A, enter in B1
=COUNTIF(A:A,"4999")-COUNTIF(A:A,"9999")

--

Regards
Roger Govier

"Amy" wrote in message
...
I would like to count the number of cells in a range that has a number in
it
that is greather than 4999 but less than 9999 - any ideas



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default if then statement

No, Amy, it is counting the numbers *greater than* 4999 (not less than), and
subtracting those greater than 9999. The result is those which are greater
than 4999 and less than or equal to than 9999.
As you wanted greater than 4999 and *less than* 9999, then in Roger's
formula I would change ,"9999" to ,"=9999"
--
David Biddulph

"Amy" wrote in message
...
Roger,
Thanks for the advice, what that equation is doing is counting the numbers
less than 4999 and subtracting the numbers that are greater than 9999

"Roger Govier" wrote:

Hi Amy

One way, with data in column A, enter in B1
=COUNTIF(A:A,"4999")-COUNTIF(A:A,"9999")

--

Regards
Roger Govier

"Amy" wrote in message
...
I would like to count the number of cells in a range that has a number
in
it
that is greather than 4999 but less than 9999 - any ideas





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default if then statement

AMY: You can see, just like I did, the wisdom and accuracy of David's reply
by testing it with a small sample. What I did is enter 4998, 4999, 5000,
9998, 9999, 10000, and 10001 into cells A1 to A7.

With this small sample, you can easily see that there is only 1 number *less
than* 4999 while there are 2 number *greater than* 9999. If Roger's formula
(as corrected by David) was doing what you said it was, it would return -1.
In contrast, it is correctly returning 2 representing the numbers 5000 and
9998, the two numbers in the sample that meet both conditions of being
greater than 4999 AND less than 9999.

Alternatively, you can also simply change substitute 9998 for 9999 in
Roger's formula and you would get the same results as David proposed.

Another way of looking at this is the formula is counting all numbers in
column A that are greater than 4999 (which in my sample is 5) and subtracting
from that the count of numbers that are greater than 9998 (which in my sample
is 3) returning a result of 2.

I know this is very verbose but I'm really doing this to personally learn
this stuff. I find that one of the best ways to test whether I have learned
something is trying to explain it to someone else. As my username suggests,
I'm just TRYING to learn. I learn a lot about logic and thinking outside the
box from these guys.

"David Biddulph" wrote:

No, Amy, it is counting the numbers *greater than* 4999 (not less than), and
subtracting those greater than 9999. The result is those which are greater
than 4999 and less than or equal to than 9999.
As you wanted greater than 4999 and *less than* 9999, then in Roger's
formula I would change ,"9999" to ,"=9999"
--
David Biddulph

"Amy" wrote in message
...
Roger,
Thanks for the advice, what that equation is doing is counting the numbers
less than 4999 and subtracting the numbers that are greater than 9999

"Roger Govier" wrote:

Hi Amy

One way, with data in column A, enter in B1
=COUNTIF(A:A,"4999")-COUNTIF(A:A,"9999")

--

Regards
Roger Govier

"Amy" wrote in message
...
I would like to count the number of cells in a range that has a number
in
it
that is greather than 4999 but less than 9999 - any ideas







  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default if then statement

=ABS(COUNTIF(A:A,"" & 4999)-COUNTIF(A:A,"" & 9998))

--
Gary''s Student - gsnu200764


"Amy" wrote:

I would like to count the number of cells in a range that has a number in it
that is greather than 4999 but less than 9999 - any ideas

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
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
if statement pwoodix Excel Worksheet Functions 3 August 16th 05 12:40 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


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