The COUNTIF function provides the ability to establish how many occurrences of a specific value or condition exist in a range of values. This function begins to increase capability with a function that is simple to operate.
If the value in G2 appears in the range B2:B38 then the formula will return 'Yes' otherwise it'll return 'No'.
COUNTIF "Counts the number of cells within a range that meet the given condition"
There are two arguments required to use the COUNTIF function, the first, range, is usually a group of cells, the second, criteria, is the argument that is used to match the cells in the range.
In this example, we'll use the COUNTIF function to establish how many time the word "day" appears in a list of text.
The range of cells that need to be checked for the word "day" exist in the range B2:B28 and the criteria we wish to count is entered as "day".
The result of this function is the following:
So we can conclude there are 7 occurrences of the word "day" in the range B2:B38.
We can also use a cell reference as the second argument as seen here:
which we can also enter in the next cell to count the occurrences of the contents of cell C3 which happens to be 3.
Using Countif to return a yes/no result if a value is in a range or not
We can also use Countif to return Yes / No if a value is present in a range by wrapping the count if function in an If function (also known as a nested function)=IF(COUNTIF($B$2:$B$38,G2)>0,"Yes","No")
Comments
Post a Comment