View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default how to count if a cell value falls between two numbers

There are a few ways to to this:
=SUMPRODUCT((A1:A535)*(A1:A5<40))

=COUNTIF(A1:A5,"35")-COUNTIF(A1:A5,"40")

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Glenn" wrote:

I tried to write a formula to count how often the value of a range of cells
falls between two numbers. for example in the chart below:

row value
1 25
2 27
3 36
4 37
5 42

I tried the formula =countif(a1:a5,and(35,<40)) and my result was "0" when
it should be "2".

Can anyone help correct my formula?

thanks

glenn
--
Glenn