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 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.
COUNTIF is a function to count cells that meet a single criteria. COUNTIF can be used to count cells with dates, numbers, and text that match specific criteria. The COUNTIF function supports logical operators (>,...
Excel Formula Training
Learn Excel formulas and functions with concise, clear videos. Master absolute/relative addresses, dates, text, named ranges, and tools for troubleshooting. Each video comes with a practice worksheet and audio transcript. Instant access and complete 100% guarantee. Start today!