REPT(“?”,N) will return a text string made of exactly N question marks. In our example REPT(“?”,2) returns “??“. COUNTIF(Range,”??”) will then count all the cells in the Range that contain exactly 2 characters because of the two “?” wildcard characters in the COUNTIF criteria. In our example Range has 3 cells which contain exactly 2 characters, so COUNTIF(Range,”??”) returns 3.

How To Count Cells That Contain Exactly N Characters - 95