Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default multiple data ranges for countif

I am trying to find the number of times my value falls in a certain range.
the data looks like this:
Clg (Tons)
500.6
486.9
473.4
465.8
469.8
510.1
497.5
538.9
623.5
688.5
671.8
687.3
673.9
690.9
716.5
713.7
704.6
665.8
606.3
599.9
582.3
497.4
498.8
478.8

and my different ranges would be in one hundred increments (i.e. 400-500,
501-600,601-700,etc.)
Any help would be great

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default multiple data ranges for countif

=COUNTIF(A2:A1000,""&B2)-COUNTIF(A2:A1000,""&C2)

B2=401, B3=501 etc
C2=500, C3=600 etc

HTH

"David G" wrote:

I am trying to find the number of times my value falls in a certain range.
the data looks like this:
Clg (Tons)
500.6
486.9
473.4
465.8
469.8
510.1
497.5
538.9
623.5
688.5
671.8
687.3
673.9
690.9
716.5
713.7
704.6
665.8
606.3
599.9
582.3
497.4
498.8
478.8

and my different ranges would be in one hundred increments (i.e. 400-500,
501-600,601-700,etc.)
Any help would be great

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default multiple data ranges for countif

"David G" wrote...
I am trying to find the number of times my value falls in a certain range.
the data looks like this:
Clg (Tons)
500.6
486.9

....
and my different ranges would be in one hundred increments (i.e. 400-500,
501-600,601-700,etc.)

....

This is what the FREQUENCY function was designed to do. If you have ranges
from 0 to =100, 100 to =200, . . ., 1900 to =2000 and your data were in a
range or worksheet cells named DATA, select a 1-column by 21-row range,
e.g., X2:X22, type the formula

=FREQUENCY(DATA,100*ROW(1:20))

hold down [Ctrl] and [Shift] keys and press [Enter]. This should enter this
formula as an array formula, with the count of 0-100 values in X2, the count
of 100-200 values in X3, etc. Cell X22 will show the number of values that
exceed 2000.

This could be done with COUNTIF, e.g., for the 300 to =400 value range

=COUNTIF(DATA,"300")-COUNTIF(DATA,"400")

but FREQUENCY handles consecutive ranges in a single batch operation, MUCH
more efficient.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default multiple data ranges for countif

=countif(A:A,500,)-countif(A:A,600)
=countif(A:A,600,)-countif(A:A,700)

and so on...

Can also do this as a pivot table. drop your values in column and in data.
Right click in the column field, select Group and Outline, Group, have it
group by increments of 100 starting at 500...


"David G" wrote:

I am trying to find the number of times my value falls in a certain range.
the data looks like this:
Clg (Tons)
500.6
486.9
473.4
465.8
469.8
510.1
497.5
538.9
623.5
688.5
671.8
687.3
673.9
690.9
716.5
713.7
704.6
665.8
606.3
599.9
582.3
497.4
498.8
478.8

and my different ranges would be in one hundred increments (i.e. 400-500,
501-600,601-700,etc.)
Any help would be great

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default multiple data ranges for countif

"Toppers" wrote...
=COUNTIF(A2:A1000,""&B2)-COUNTIF(A2:A1000,""&C2)

B2=401, B3=501 etc
C2=500, C3=600 etc

....

Classic mistake. Note that the OP's VERY FIRST data point was 500.6.
However, using your intervals above, the formula for the next range using
your formula above would be

=COUNTIF(A2:A1000,""&B3)-COUNTIF(A2:A1000,""&C3)

which would be equivalent to

=COUNTIF(A2:A1000,"501")-COUNTIF(A2:A1000,"600")

So both your original formula and my extension of it to the next interval
would skip the value 500.6. It would have been safer to use just one set of
bounds

B2: 400
B3: 500
B4: 600

and formulas like

=COUNTIF(DATA,""&B2)-COUNTIF(DATA,""&B3)

=COUNTIF(DATA,""&B3)-COUNTIF(DATA,""&B4)

The second of these would include 500.6 in its count. I really doubt the OP
would have wanted to exclude data points for which 0 < MOD(x,100) < 1.


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 for multiple ranges and criteria MML Excel Discussion (Misc queries) 7 May 25th 07 09:54 PM
Using Multiple, Noncontiguous Ranges in COUNTIF? PBJ Excel Discussion (Misc queries) 0 October 11th 06 05:45 PM
COUNTIF() With multiple ranges and variables Thansal Excel Discussion (Misc queries) 3 July 12th 06 05:32 PM
COUNTIF with multiple disjoint ranges, same criteria CLR New Users to Excel 0 March 3rd 06 08:00 PM
COUNTIF Statement with Multiple Conditions in Different Ranges KJA Excel Worksheet Functions 2 April 26th 05 05:14 PM


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