Excel COUNTIF Function to Count Cells Greater Than 0

Download the Practice Workbook


Introduction to the COUNTIF Function

  • Syntax

COUNTIF(range, criteria)

  • Arguments

range: Range of cells to be selected.

criteria: Criteria of the cells that need to be assigned.

  • Function

Counts the number of cells within the range that meet the given condition.

  • Example

In the picture below, a list of color names is given. If we want to know how many times Red is there then we have to type in the output cell-

=COUNTIF(B2:B11,"Red")

After pressing Enter, we’ll see there are 4 instances of Red in the list.

countif greater than 0


6 Examples of COUNTIF Function to Count Greater Than 0 (Zero)


Example 1 – Count Cells Greater Than 0 (Zero) with COUNTIF

We have a dataset of goals and assists in 15 matches of a footballer in a season. He has not played 2 matches (Matches 6 and 9) and the cells are blank there. We want to count how many goals he has scored.

Steps:

  • Select output Cell F13 and insert:
=COUNTIF(C5:C19,">0")
  • Press Enter.

countif greater than 0

NOTE: Keep in mind, while inputting the criteria for greater or less than a number in the COUNTIF function, you have to put it between Double-Quotes(““).

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


Example 2 – Add Ampersand (&) with the COUNTIF Function to Count Cells Greater than 0 (Zero)

Steps:

  • Use the following formula in Cell F13:
=COUNTIF(D5:D19,">"&0)
  • Press Enter.

countif greater than 0

We’re using Ampersand(&) after Double-Quotes to join the “Greater Than” criteria with 0.

Read More: Excel COUNTIF with Greater Than and Less Than Criteria


Example 3 – Compute Cells with Value Greater Than or Equal to 0 (Zero) with Excel COUNTIF Function

Steps:

  • In Cell E13, use:
=COUNTIF(C5:C19,">=0")
  • Press Enter.

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


Similar Readings


Example 4 – And Less Than Another Number with COUNTIF to Count Greater Than 0 (Zero)

We want to find the number of values greater than 0 but less than 2.

Steps:

  • In Cell F13, use
=COUNTIF(C5:C19,">0") - COUNTIF(C5:C19,"<=2")
  • Press Enter.

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


Example 5 – Utilize the COUNTIFS Function under Multiple AND Criteria from Different Columns

We want to know how many matches the footballer has scored goals as well as provided assists.

Steps:

  • In Cell F13, use
=COUNTIFS(C5:C19,">0",D5:D19,">0")
  • Press Enter.

NOTE: To add multiple criteria, use a Comma(,) to separate two criteria.

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


Example 6 – Combine COUNTIF and COUNTIFS Functions under Multiple OR Criteria from Different Columns

We’re going to find the number of matches where the player has either scored goals or provided assists.

Steps:

  • In Cell F13, the formula is:

=COUNTIF(C5:C19,">0") + COUNTIF(D5:D19,">0") - COUNTIFS(C5:C19,">0",D5:D19,">0")

  • Hit Enter.

How Does The Formula Work?

By using Plus (+) between two COUNTIF functions, we’re separately determining the number of matches the player has scored goals & provided assists. So, here the return value will be 9+8=17. The COUNTIFS function will find out how many matches the player has both scored goals & provided assists. Here the resultant count is 7. By subtracting the resultant value found through the previous step from that of 1st step, the final output will be 10 (17-7=10).

Read More: Apply COUNTIF Function in Multiple Ranges for Same Criteria


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Nehad Ulfat
Nehad Ulfat

NEHAD ULFAT is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including ABACUS, AutoCAD, Rhinoceros, Maxsurf, and Hydromax. He got his B.Sc in Naval Architecture & Marine Engineering from BUET but switched gears, working as a content developer.  In this role, he creates techy content all about Excel... Read Full Bio

2 Comments
  1. There are a load of numbers in my cells and I just get 0.

    • Thank you, Dan, for your comment. If the values are in text format, then the COUNTIF function will return zero. You can see that we have used a IF formula, which returns TRUE when the value from column B is greater than five. Notice the output is in text format.

      • Now, if we want to count the number of FALSE in the column C, it will return zero.

      • There are two solutions for this issue. Firstly, you can add asterisks (*) with the criteria.

      • Another way is to change the formula in column C to return TRUE or FALSE as Boolean values.

      • Then, the COUNTIF function will return the correct value.

      However, if this doesn’t solve your problem, you can mail us your Excel file to: [email protected], and we’ll try to solve it as soon as possible.

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo