Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formulas in Excel using Counif function 1

Status
Not open for further replies.

Caspers

Technical User
Nov 22, 2002
19
GB
I am trying to create a formula using the countif function to determine how many cells within a range are greater than 50 but less than or equal to 60. Any ideas?
 
Do you need to use COUNTIF?

If you use this formula it works assuming the numbers are in cells A1 through A10:

=SUM((A1:A10>50)*(A1:A10<=60))

make sure once you have typed it in that you make it into an array formula by doing a CTRL-SHIFT-ENTER

 
Another cheat would be to add a second column and stick an if/and in there.

Assuming that your values are in column A from rows 1 to 10, put the followind in B1 and copy it down to B10:
Code:
=IF(AND(a1>50,a1<=60),1,0)

This will give you either a 1 or a 0 in the cells B1 to B10. Now do a countif on the cells in column B:
Code:
=COUNTIF(b1:b10,&quot;1&quot;)

If anyone knows how to put an AND into a COUNTIF, please add the solution to this thread, as I have been using this extra step for quite a while. Thanx :)

Carol
Berlin, Germany
 
Another fix that does not require the fomulae to be an array

=COUNTIF(A3:A12,&quot;>50&quot;)-COUNTIF(A3:A12,&quot;>60&quot;)
 
deep2731, that is lovely. Simple, so easy to remember. Thanx :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top