Tom’s Tutorials For Excel: SUMIF With Character Count Criteria
With the question mark wildcard character, which represents one placeholder character of any kind, you can sum or count items in a list based on a minimum, maximum, or exact count of characters.
In the pictured example, column A contains stock number items, but also for “Gift” items. Because the word “Gift” contains 4 characters, and all stock numbers contain at least 5 characters, you can sum for numbers in column B that correspond to stock items that have at least 5 characters.
The formula in cell D2 is
Note that the five wildcard question mark characters followed by the wildcard asterisk character, represents the criteria requirement of at least five characters.