Basic formula for COUNTIFThe syntax for the COUNTIF function is: Show
Where, Range is group of cells that we need to search for. Criterion can be any of any of the followings;
There are some rules to follow depending upon data range contains number or text values while specifying the criterion in the COUNTIF function. If the data range contains numbers:
If the data range contains numbers:
How to enter the COUNTIF function in Google SheetsWhen you enter any function in Google sheets, an auto-suggest box pops up to follow that function syntax instead of a dialog box in Excel. Like when we will enter COUNTIF function in Google Sheets auto-suggest box will popup; containing syntax, example, summary related to COUNTIF function and explanation of each part of function as shown below. In this article, we will discuss the COUNTIF argument with some criterion for more clarification. Please follow these steps to enter COUNTIF function in Google Sheets.
Suppose we have sales dataset of some inventory items and we want to use COUNTIF function in Google Sheets to perform the following calculation on this data set. Count of Sales Greater Than $400Now we want to test the sales range of B2:B9 again this criterion expression of “>400”. As data range contains numeric values, so we will place the express in double quotation marks, as shown below You can see the COUNTIF function has tested the selected sales data and counted the values against specified criterion where sales figures are greater than $400 and returned the result as 2
Now we will use comparison operator and cell reference in criterion expression to count sales that are greater than the value mentioned in cell reference, such as D2. We will join comparison operator and cell reference by using an ampersand (&). Comparison operator will be placed in double quotation marks, whereas cell references will not be enclosed in double quotation marks, such as “>”&D2
Count of Sales Equal toIF we want to count the sales figure found in a data range that is exactly equal to a specified value, say $200, the COUNTIF function will be as follows;
Here, we will not use the equal sign “=” as comparison operator in criterion expression and criterion numeric value will not be enclosed in double quotation marks. Count of Text value or stringWe can count the number of times a text value or text string appears in data range in Google Sheets using COUNTIF functions;
Criterion text value will be enclosed in double quotation marks, and cell reference of that value will be used in the formula without double quotation marks, like;
Here you can see that COUNTIF has returned the output as number of times (5) a text value is found in data range to test for. Count of Text value using WildcardYou can count any instance of a text value in a data range using wildcards, like “*” and “?”. Wildcard search is not case sensitive and it will count any instance of text value, like
As criterion text value can be found anywhere in a text string of selected range, then we will place “*” wildcard in start and end of this text value. IF you have to count the occurrence of text value only at the end of a text string in the data range, then the formula would be;
Still need some help with Excel formatting or have other questions about Excel? Connect with a live Excel expert here for some 1 on 1 help. Your first session is always free. What is Countif?The COUNTIF function is a premade function in Excel, which counts cells as specified. It is typed =COUNTIF. NOTE: The COUNTIF function can have basic or more advanced uses. This covers the basic use for how to count specific numbers and words.
Which function is used to count the number of cells?The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers.
What function counts the number of cells specified by a given set of conditions or multiple criteria?Excel COUNTIFS function - syntax and usage
The Excel COUNTIFS function counts cells across multiple ranges based on one or several conditions.
How Countif function works in Excel?The Microsoft Excel COUNTIF function counts the number of cells in a range, that meets a given criteria. The COUNTIF function is a built-in function in Excel that is categorized as a Statistical Function. It can be used as a worksheet function (WS) in Excel.
What does Counta () function do?The COUNTA function counts cells containing any type of information, including error values and empty text (""). For example, if the range contains a formula that returns an empty string, the COUNTA function counts that value. The COUNTA function does not count empty cells.
Which of the following function can count both the number and the text from a specific range?Detailed Solution. The correct answer is COUNT IF. COUNT IF function in MS-Excel counts the number of cells within a range that meet the given condition.
|