Count Cells Greater Than Set Amount With Excel COUNTIF Function

One of the tasks you have to do quite often in Excel is to count things. For example, you could have a list of students and their test scores.


If the passing score is 50, how can you get Excel to count the number of students who passed the test?

 Use COUNTIF and an Operator

The Excel COUNTIF function will count cells, based on the criteria that you enter. As part of the criteria, you can use an operator, such as greater than, or less than, to count a specific range of numbers.

In this example, the passing score is 50. To find the students who failed the test, you'd count the scores that are less than 50 -- <50.

To include this operator in the COUNTIF criteria, enclose the operator and number in double quote marks.



Use a Cell Reference with COUNTIF Criteria

Instead of typing a number in the COUNTIF criteria, you can use a cell reference. In this example, cell F5 contains the passing score.

To find the students who passed the test, you'd count the scores that are greater than or equal to the value in cell F5 -- >=F5.

To include a cell reference and operator in the COUNTIF criteria, enclose the operator in double quote marks, and use an ampersand before the cell reference.

=COUNTIF(B2:B11,">=" & F5)


Cell Reference Automatically Updates

An advantage to using a cell reference in the COUNTIF criteria is that the result will automatically update, if the value in the referenced cell changes. In the screenshot below, you can see that the passing score has been increased from 50 to 70. Because the Passed formula uses a reference to cell F5, the count is automatically updated. The Failed formula has the passing score of 50 typed into the criteria, so that value would have to be changed, before the result is updated.


Watch the COUNTIF Video

To see the steps for creating a COUNTIF formula with an operator, you can watch this short Excel tutorial video.


You may also like...

32 Responses

  1. Kanti Chiba says:

    Hi Debra,

    When using a cell reference in the COUNTIF formula, you could enter the >= directly in the cell.
    So that in the above example F5 would be >=50 and the formula would be COUNTIF(B2:B11,F5).

    I have used the above with COUNTIF(xxx,xx) – COUNTIF(xxx,yy) to arrive at the count between two values
    Enjoy your blog very much, thanks for all the effort



  2. Clarity says:

    Great Blog, thanks.

    Excel 2007 also has the additional function of COUNTIFS:

    =COUNTIFS(criteria range 1, criteria 1, criteria range 2 ….)

    This enables you to count the number of cells based on multiple criteria. An excellent addition from Microsoft.

  3. Contextures Blog » Quickly Change Results for Excel COUNTIF Function says:

    […] month we looked at the COUNTIF formula, and how you can type an operator, then refer to a worksheet cell, to set a minimum value for […]

  4. Manny says:

    Thank you very much for the countif(B2:B11,”>=” &F5) formula. Very helpful.

  5. Wilma Robles says:

    how will I count cells in a given range whose dates are not greater than 2/20/2013?

  6. Sass says:

    Thank you so much Debra, I’ve been working on this all day and went to numerous sites and chat rooms to find assistance with no luck, until i found your post… thank you so much, you are wonderful!

  7. Sass says:

    Sorry, another quick question, I have Excel 2003 is there an alternative for countifs with multiple range options and multiple criterion or would i be best using sumproduct?

  8. vinay yadav says:


    need a help!!! i need to find the number of cells in a row which are greater than a certain value.

    problem is i my data is available in every fourth cell of the row. i am able to use the Mod and Array formula to arrive at the sum of these cells but finding the count is difficult

  9. Spreadsheetninja says:

    Countif requires “>” & A1
    (replace > whit needed symbol > = <= and A1 whit apropriate cell\cells\ranges ect

  10. Michael says:

    Hi Deb,

    I’m attempting to use the countif command to find the percent of my class that passed a test. With this command setup when 3 students pass, it returns 300%. Do I need additional data in the command such as dividing the passing students buy the total number of students. Hope that makes sense. And thanks in advance.


    • Andrew says:

      Did you get an answer for this? It is exactly what I am trying to do and what is happening to me?

    • MrPshaw says:


      Would give you count of passing scores divided by count of total scores which should be percent passed.

  11. KevL says:

    HI, interesting article thanks. I have a COUNTIFS formula that works perfectly in Excel 2007 but had to save the spreadsheet for another user who only has Excel 2003. The results just return #NAME?. The EX07 formula is in B2 and counts a range of numbers in col A.
    COUNTIFS(A2:A100,”>=50″,A2:A100,”<=59"). How can I re-write this for Excel 2003. Thank you.

  12. CamK says:


    I’m trying to use a COUNTIFS formula in a spreadsheet to count the number of cells where the value is a range. I have 3 ranges

    Under 500 (easy as can use less than
    Over 1000 (easy as can use more than.
    Between 500 and 1000 – I’m stuck… Have tried =COUNTIFS(B$2:B$30,”NAME”,C$2:C$30,”>500:<1000") But it's not working. (I"ve also subbed a comma instead of colun.)

    Any ideas?

  13. M says:

    How can I count the number of times the value of a cell equals to or is less than 0:26 minutes. The cell is formatted as Time 13:30.

  14. Kim Gilbert says:

    Hi There, I am trying to perform a calculation using the datedif to count the days between two dates and if the total is less than 30 to enter 0 in that cell. Help ?

  15. Andrew says:

    I have times which I need to count how many are below a certain time
    each line below is an example
    12:59 AM,3:07 AM,2:51 AM,2:30 AM,12:06 AM times below 3:00 AM
    11:42 PM,12:05 AM,12:07 AM,10:57 PM,11:45 PM times below midnight
    1:05 AM 12:55 AM,1:03 AM,12:25 AM,1:00 AM times below 1:00

    as these are in 24 hour I cannot find a formula that works (I have tried countif but this gives false answers i believe its due to passing midnight)
    any help would be great

    Thanks Andy

  16. Jon says:

    I am attempting to reference a date that correlates to the twentith count of another column. That’s number one problem.

    The second is the sum of the other 12 columns between those dates. Right now it looks like this sumif($L,”>0″,$B)
    This can easily become sumifs and include the dates but I want the dates to auto populate for every 20 items in column L.

    Column A are all dates.
    Column B have decimals.
    Column L is either 0 or 1.

    Thanks in advance.


  17. HMA says:

    Thanks, your explanation very clear and well understood

  18. Soyini says:

    Hello…I am using the countif formula (COUNTIF(E7, “>=” &G7)) to determine the number of PE students who meet a certain requirement on their fitness testing…students have to improve by 20% in all post-tests…here’s the problem…if a student equals the 20% requirement, then the formula doesn’t count…in fact, I changed the formula to “=” just to see what would happen and it wouldn’t count…any suggestions?

  19. grey says:

    I am hoping you can assist. I am trying to add any 4 numbers, where I have over 1000 numbers and reach a total of less or equal to 100. I want to know how many instances I can do this and how to identify the specific numbers. How do I write such a formula. Any assistance is appreciated. Thank you.

  20. Russ1965 says:

    I am trying to work out a formula , I have a countif statement, that counts the number of says some one attends to lets say the person can attend 1 day for £30 or up to 7 days at £210, if they attend all 7 days, I can then give them a discount of 10%..anyone help

  21. Russ1965 says:

    I am trying to work out a formula , I have a countif statement, that counts the number of Days someone attends a class, so lets say the person can attend 1 day for £30 or up to 7 days at £210, if they attend all 7 days, I can then give them a discount of 10%..anyone help

  22. WAMAN KINEKAR says:

    thank you sir!

  23. Haider says:

    How to give a format to those values whose sum is less than a value we put (like: 1000)

  24. Denis says:

    Help needed please! I have to calculate how often a monitor reading exceeds a limit value (0.30) for more than three minutes. To be clear the continuous monitor is measuring values every 5 seconds and if the value exceeds 0.3 continuously for more than three minutes that counts as a fail. I download a huge data set each month two colums ‘Value’ and time

  25. Arthur says:

    I am working on a Sales spread sheet. That tracks sale date product codes and several other thing. I have a stats page that then takes the sale date and count the different products per month to see how much of each product is sold. The catch is that several of the products have multiple codes based on the different promotions the customer may get. Thos codes can also change often so I am trying to set up the Countif to have the products codes listed on another sheet and reference them for deciding what codes are counted. Here is an example of what the equation looks like right now.

    =(SUM(COUNTIFS(‘data new’!D2:D1114,”>=”&”2018-1-1″,’data new’!D2:D1114,”<"&"2018-2-1",'data new'!C2:C1114,{"abc","mno","4ho","EE("})))

    Where "abc","mno","4ho","EE(" are the codes that are for the same product just different prices based on what else was purchased.

    Is there a way to have a separate table that will say product A is "abc","mno","4ho","EE(" and link to that table so when a new code comes out I can just add the code to the table and not have to use find replace to edit the equations for all the months that are being tracked?

Leave a Reply

Your email address will not be published. Required fields are marked *