COUNTIF Excel Function is also one of the most used function in excel. This helps the user to calculate the number of counts based on single logic given by the user. You can use this function for multiple purposes like:
1. Counting the occurrence in an excel range if meets a criteria i.e. exact value matching, partial value matching, more than or less than of a numeric value
2. Check whether one value exist in other range
3. Count the occurrence if equal to either of values etc.
Below is the syntax for COUNTIF Function in excel:
1. Â =COUNTIF(Range,Criteria)
– Range:Â It is an excel range in which you want to count the occurrence of your criteria.
– Criteria: This is a criteria basis on occurrence in the range being counted
COUNTIF can be used for multiple purposes like
– When you want to count the occurrence of single logic in an excel rangeÂ
– Also you can use to verify whether one cell value exist in other range. It helps to match one excel range to another range
– You can also count of a value when a criteria in excel range matches, contains, not equal to etc. via wild characters (will discuss this further)
– You can use this function as a logical argument to check if True or False. This can help you in conditional formatting
Things To Remember
 – Works with Single Logic and one range (either row or column)
–Â COUNTIFS can be used for multiple logics
 – If your excel range is linked to other workbook, then this function will return #value error when workbook is closed
–Â Double quotes (” “) should be used when you are using wild characters or not linking the Criteria to Proper Text or Value instead of Excel Cell
Below we are using sales data which contains revenue details for different clients. So here we are going to count the values for particular state.Â
Suppose you want to count the sales made to clients who belong to state”VA”. So you need to write COUNTIF formula as
=COUNTIF(D:D,"VA")
Here my state details are available in Column D. That’s why I selected D:D range and then typed “VA” as text. So function will check the range and count the occurrence of “VA” state in the given range and retunr the number of count.
You can link the criteria to Cell as shown in below image and get the results:
Now suppose you want to count the cells which are not equal to blank cells or any other value in an excel range. You may use this syntax:
=COUNTIF($D:$D,"<>"&"")
Here “<>” is a wild character which is being used for “Not Equal” Criteria and “&” is used to connect one string to another. So here I am using & to connect “<>” with my criteria “” (Non Blank Cells). You can use any string or value or cell to count cells in a range when not equal to. Below are few more criteria examples:
– Count when not equal to
 “<>”&””
– Count when not equal to value available in cell G2
 “<>”&G2
– Count when not equal to State “VA”
 “<>”&”VA”
Now suppose you want to count the cells which are more than a numeric value in an excel range. You may use this syntax. Here we are counting the clients who paid more than $50 by checking Column B
=COUNTIF($B:$B,">"&50)
Similar to above example, we are using wild character “>” when more than. You can use different wild characters for counting the numbers in an excel range
– Count when more than 50
  “>”&50
– Count when more than to value available in cell G8
  “>”&G8
– Count when less than 50
  “<”&50
– Count when less than to value available in cell G8
  “<”&G8
You can use combination of “>=” or “<=” for when value equals & more than or equals & less than respectively
Now suppose you want to count the cells when cell contains particular string in an excel range. You may use this syntax. Here we are counting the clients whose name contains “Tamm” Column A
=COUNTIF($A:$A,"*"&"Tamm"&"*")
Similar to above example, we are using wild character “*”&Value/Cell&”*”. This is used to check the range, if contains. Here are few more syntax which are mostly used
– Count when cell value begins with
 “Tamm”&”*”
 G11&”*”
– Count when cell value ends with
 “*”&“Tamm”
 “*”&G11
– Count when cell contains
 “*”&“Tamm”&”*”
 “*”&G11&”*”
Hope you liked this article. Please comment below for any queries and yes, please do not forget to follow us or subscribe us as below
If you want to print your Excel spreadsheets with gridlines, this guide is for you. Adding gridlines makes your data easier to read and gives your spreadsheet a clean, organized look. In this post, we’ll…
In this guide, you will learn how to use the NPV function in Excel to calculate the net present value of an investment and how to avoid common mistakes when using NPV in Excel.
Microsoft Excel “NOW” function is used to get the current Date and Time. It is very useful function and can be used in many ways.
RIGHT function is used for extracting the “Right Most” characters from the available string in Microsoft excel. Function returns value to new string.
MIN function is used to get the smallest number in range or list of values.MIN function has one required i.e. number1 and optional argument i.e. [number2]
This guide explains the basics of Excel’s Advanced Filter and shows you how to use it to find records that match one or more complicated conditions.
If you’ve read our previous guide, you know that Excel’s regular filter offers different options for filtering text, numbers, and dates. These options work well for many situations, but not all. When the regular filter isn’t enough, you can use the Advanced Filter to set up custom criteria that fit your exact needs.
Excel’s Advanced Filter is especially useful for finding data based on two or more complex conditions. For example, you can use it to find matches and differences between two columns, filter rows that match another list, or find exact matches with the same uppercase and lowercase letters.
Advanced Filter is available in all Excel versions from 365 to 2003. Click the links below to learn more.