w3resource

Excel Formulas - Count number of cells that contain specific number of characters

Count number of cells that contain five characters only

Count no. of cells that contain five characters only

Syntax of used function(s)

COUNTIF(criteria_range, criteria)

The COUNTIF function is used to count the number of cells that meet a certain criteria.

Explanation

To count the number of cells that contain only five characters the COUNTIF function can be used with wildcard character as criteria.>


=COUNTBLANK(C5:C11)

How the formula works

In the above formula written in the cell D8 shows that the criteria is "?????". The wildcard "?" indicates only one characters, it means that the COUNTIF function will search for five characters in the range B5:B11. Therefore the COUNTIF function count only those cells where only five characters found.

Count number of cells that contain a specific number of characters using range name

Count no. of cells that contain a specific number of characters using range name

Formula


=COUNTIF(Employee,D8)

How the formula works

In the above example the range B5:B11 assigned by a name Employee and the criteria varrible D8 have been used. The COUNTIF function search the criteria within the range Employee, and counts if matched, and returns the result.

Count number of cells that does not contain a specific number of characters

Count no. of cells that does not contain a specific no. of characters

Formula:


=COUNTIF(Employee,D8)

How the formula works

In the above example the COUNTIF function have been used to count the number of cells that does not contain a specific number of characters mentioned in a criteria variable D8.

Count number of cells that contain the text of 5 characters and end with the letter y.

Count no. of cells that  contain the text of 5 characters and end with the letter y.

Formula


=COUNTIF(Employee,D8)

How the formula works

In the above example the COUNTIF function have been used to count the number of cells that contain a text of five characters. Within the text the last character must be 'y'.
In the criteria variable the wildcard have been used as "????y". That means the first four characters may be any character by the last is 'y'. The range have been assigned by a name "Employee".

Count number of cells that contain the text of 5 characters in which 4th character is e.

Count no. of cells that  contain the text of 5 characters in which 4th character is  e.

Formula


=COUNTIF(Employee,D8)

How the formula works

In the above example the COUNTIF function have been used to count the number of cells that contain a text of five characters. Within the text the forth character must be 'e'.
In the criteria variable the wildcard have been used as "???e?". That means except the forth character remaining characters may be any character and the forth one is 'e'. The range have been assigned by a name "Employee".

Previous: Excel Formulas - Count number of cells which are blank
Next: Excel Formulas - Count cells for equality



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/excel/formulas/count/count-no-of-cells-that-contain-specific-number-of-characters.php