Exceljet

Quick, clean, and to the point

Count cells that contain five characters

Excel formula: Count cells that contain five characters
Generic formula 
=COUNTIF(rng,"?????")
Explanation 

To count the number of cells that contain a certain number of characters text, you can use the COUNTIF function. In the generic form of the formula (above), rng is a range of cells, and "?" is a wildcard matching any single character.

In the example, the active cell contains this formula:

=COUNTIF(B4:B9,"?????")

How this formula works

COUNTIF counts the number of cells in the range that contain five characters by matching the content of each cell against the pattern "?????", which is supplied as the criteria for COUNTIF. The "?" symbol is a wildcard in Excel that means "match any single character", so this pattern will count cells that contain any five characters. The count of cells that match this pattern is returned as a number which, in the example, is the number 2.

 

 

Author 
Dave Bruns

Excel Formula Training

Formulas are the key to getting work done in Excel. In this accelerated video course, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn powerful skills to troubleshoot, trace errors, and fix problems. This is the formula training you should have had to begin with. See details here.

I love to use excel and use it a lot in my work. Your tips, tricks and examples have helped me enormously. - Lisa
Excel foundational video course
Excel Pivot Table video training course
Excel conditional formatting video course
Excel formulas and functions video training course
Excel Shortcuts Video Course