Excel COUNTIF with Greater Than and Less Than Criteria

 

Download the Practice Workbook


6 Examples of Using COUNTIF to Count Cells in Excel for Greater Than and Less Than Conditions

We have a sample dataset of an employee salary sheet. We’ll count cells that fulfill our criteria using the COUNTIF function.

Sample Dataset to Apply COUNTIF for Greater than and Less than Criteria


Example 1 – COUNTIF for Counting Cells Greater Than a Value

Let’s count the number of employees who get a gross salary greater than $4,500.

Steps:

  • Select a blank cell for the result (such as I5) and insert the following formula.
=COUNTIF(F5:F15,">4500")
  • Press the Enter key.

COUNIF Function to Count Greater than a Value

Note:

>” means greater than, “<“ means less than, and “>=” means greater than or equal.

Read More: Excel COUNTIF Function to Count Cells Greater Than 0


Example 2 – COUNTIF for Counting Cells Less Than a Value

Let’s count the number of employees who have a gross salary of less than $4,500.

Steps:

  • Enter the following formula in the result cell and press Enter.
=COUNTIF(F5:F15,"<4500")

COUNTIF Funciton to Count Less Than a Value

Read More: How to Use COUNTIF Between Two Numbers (4 Methods)


Example 3 – COUNTIF for Counting Cells That Have Greater Value Than a Particular Cell Reference

Steps:

  • We put a separate cell, H8, for the criterion and listed a salary value.

Insert Criteria Value in a Cell

  • Enter the following formula in the result cell I5 and press Enter.
=COUNTIF(D5:D15,">"&H8)

COUNTIF Fucntion to Count Greater than a Cell Value

Read More: How to Apply COUNTIF Between Two Cell Values in Excel


Example 4 – COUNTIF Function for Counting Cells With Lower Values Than a Particular Cell

Steps:

  • Click on cell H8 and put your criteria value.

Record Criteria Value in a Cell

  • Enter the following formula in the result cell I5 and press Enter.
=COUNTIF(D5:D15,"<"&H8)

COUNTIF Function to Count Less than a Cell Value

Read More: How to Use COUNTIF for Date Range in Excel (6 Suitable Approaches)


Similar Readings


Example 5 – COUNTIF Function for Counting Dates Succeeded by Another Date

Let’s find how many employees joined after 1 Jul 2020.

Steps:

  • Click on cell H8 and put your criteria date (7/1/2020).

Record Criteria Date in Cell

  • Insert the following formula in the result cell I5 and press Enter.
=COUNTIF(C5:C15,">"&H8)

COUNTIF Function to Count Values Greater than Date Value

Read More: COUNTIF Date Is within 7 Days


Example 6 – COUNTIF Function for Counting Dates Preceded by Other Dates

Let’s count the number of employees who joined before 1 Jul 20.

Steps:

  • Click on cell H8 and insert the criteria date.

Record Criteria Date Value in a Cell

  • Insert the following formula in the result cell I5 and press Enter.
=COUNTIF(C5:C15,"<"&H8)

COUNTIF Function to Count Dates Less Than a Date

Read More: Count Blank Cells with Excel COUNTIF Function: 2 Examples


How to Use the COUNTIF Function to Apply Multiple Greater or Less Than Criteria in Excel

Case 1 – Within Same Range:

Let’s find the number of employees with a gross salary greater than $4,000 but less than $5,000.

Steps:

  • Insert the following formula in the result cell I5 and press Enter.
=COUNTIF(F5:F15,">4000")-COUNTIF(F5:F15,">=5000")

COUNTIF Function to Apply Multiple Criteria within Same Range


Case 2 – Within Different Ranges:

Let’s find the number of employees with a gross salary greater than $4,500 and other allowances lower than $1,000.

Steps:

  • Insert the following formula in the result cell I5 and press Enter.
=COUNTIF(F5:F15,">4500")-COUNTIF(E5:E15,">=1000")

COUNTIF Function Formula to Apply Multiple Criteria within Different Ranges

Read More: COUNTIF That Does Not Contain Multiple Criteria in Excel


Things to Keep in Mind

  • You need to use the double quotes (“ ”) in the COUNTIF function when creating conditional checks.

Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdul Kader
Md. Abdul Kader

MD. ABDUL KADER is an engineer with a talent for Excel and a passion for VBA programming. To him, programming is like a time-saving wizard, making data manipulation, file handling, and internet interactions a breeze. His skill set extends to SWM, GIS, RS, and SPSS. He holds a B.Sc in Urban & Regional Planning from Chittagong University of Engineering and Technology and has shifted to become a content developer. In this role, he crafts technical content centred around... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo