View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default formula to find how many cell have a number between 2 numbers.

One more common approach...(still using the example I posted):

F1: =COUNTIF($B$2:$B$9,"<="&E1)-COUNTIF($B$2:$B$9,"<"&D1)

--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)


"Ron Coderre" wrote in message
...
Here are a few options

Example:
With this list in A1:B9
Name Days
Alpha 15
Bravo 22
Charlie 29
Delta 36
Echo 43
Foxtrot 50
Golf 57
Hotel 64

and these start/end numbers in D1:E3
1 30
31 60
61 90

Then....for a traditional approach:
OPTION_1
F1: =SUMPRODUCT(($B$2:$B$9=D1)*($B$2:$B$9<=E1))

OR.....Since your ranges are in tidy groups of 30:
OPTION_2
F1: =SUMPRODUCT(--(CEILING($B$2:$B$9,30)=E1))

OR....for a non-traditional approach:
F1: =INDEX(FREQUENCY($B$2:$B$9,D1:E1-{1,0}),2)

Copy whichever formula you choose down, copy it through F3

Using my posted example:
F1 returns 3
F2 returns 4
F3 returns 1

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)



"SCOTTAFRED" wrote in message
...
I have a column that counts the number of days a person in assigned to my
unit. I am trying to make a formula to count how many people have been
in my
unit for 1-30 days, 31-60 days and 61-90 days.