COUNTIF

COUNTIF(range, criteria)

Returns the number of numerical values that satisfies one condition.

rangeThe range of cells from which you want to count the cells.
criteriaThe logical test that will filter out the data.

REMARKS
* This function is only available for backwards compatibility and should not be used.
* COUNTIFS was added in Excel 2007 to replace this function.
* When replacing this function with the COUNTIFS function, remembering to change the order of the arguments.
* This function includes hidden cells.
* This function is not case sensitive when matching text strings.
* This function supports wildcards (? and *).
* Wildcard character: ? = a single character.
* Wildcard character: * = multiple characters.
* To include the actual wildcard characters use a tilde prefix (~?), (~*) and (~~).
* This function uses the actual cell values and not the displayed formatted values.
* If you are checking for numerical conditions make sure the cells contain numbers and not text.
* The "range" must be a cell range or a named range.
* The "range" does not have to be sorted into any order.
* The "criteria" can be a cell reference or a named range.
* The "criteria" can be in the form of a number, expression, or text.
* The "criteria" can be expressed as numerical (i.e. 32) or as a string (i.e. "32").
* The "criteria" can use string matching, i.e. *M* is all words that contain the letter "M". This is not case sensitive.
* The "criteria" can use string matching, i.e. ?M is all words that have the letter "M" as there second character.
* You can use the IF function to return a value based on one condition.
* You can use the COUNT function to return the number of numerical values.
* You can use the COUNTIFS function to return the number of numerical values that satisfies multiple conditions.
* This is similar to the AVERAGEIF and SUMIF functions.
* This function has been available since Excel 1997.
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.com

 ABC
1=COUNTIF(B1:B5, "Jan") = 2.0Jan30
2=COUNTIF(B1:B5, "=Jan") = 2.0Feb40
3=COUNTIF(B1:B5, "=Feb") = 2.0Jan20
4=COUNTIF(C1:C5, "<>20") = 4.0Feb60
5=COUNTIF(C1:C5, "=20") = 1.0Mar80
6=COUNTIF(C1:C5, ">" & C3) = 4.0  
7=COUNTIF(B1:C8, "*") = 5  
8=COUNTIF(B1:C8, "*B, ") = 2  
9=COUNTIF(B1:C8, "*b, ") = 2  
10=COUNTIF(B1:C8, "???") = 5  
11=COUNTIF(B1:C8, "?e, ") = 2  
12=COUNTIF(B1:C8, "Y") = 0  
13=COUNTIF(B9:C9, "<") = 0  
14=COUNTIF(B9:C9, "<") = 0  
15=COUNTIF(B1:C8, "Y") = 0  

1 - This counts the number of cells that contain the text "apples".
2 - This counts the number of cells that contain a negative number.
3 - This counts the number of cells that contain a number less than 40.
4 - This counts the number of cells that contain a number greater than 40.
5 - This counts the number of cells that contain non zero values.
6 - This counts the number of cells that contain a value between 1 and 100.
7 - This counts the number of cells that contain text.
8 - This counts the number of cells that contain the letter "B". This is not case sensitive.
9 - This counts the number of cells that contain the letter "b". This is not case sensitive.
10 - This counts the number of cells that contain only three letters.
11 - This counts the number of cells that have the letter "e" as their second character.
12 - This counts the number of cells that contain the text "Y".
13 - This counts the number of cells that contain a date that is less than todays date.
14 - This counts the number of cells that contain a date that is less than 30 days before todays date.
15 - This counts the number of cells that contain either the text "Y" or the text "N".

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top