Dear
@Frustrated_excel274,
I have created a solution to your problem that does not require the use of any VBA code. It is a simple XLSX file. It does use utilize array formulas, however, which need to be entered with CTRL-SHIFT-ENTER. My example file also uses conditional formatting on the output range to visually identify the larger numbers, although this is not necessary to solve your problem. In an effort to be helpful and save you (and future readers) time, I have posted my proposed solution to the cloud. It can be accessed here:
Files shared via Tresorit. [
NOTE TO FORUM MODS: Before deleting this post because it contains a filesharing link, please see below for additional explanation and context that should qualify this post for exclusion from Rule #4 despite the fact that it contains a link pursuant to the unwritten verbosity corollary.]
The sample strings you provided are in cells A2:A4. Cells B2:4 calculate the length of each such string, and cells C2:C4 calculate the number of sequential 5-character sub-strings (called “Blobs” in the file) that can be contained in each such string. Columns D:S contain every Blob for each string in the same row as the base string.
Each cell in range A7:A57 contains the array formula that looks to the Blob output range and isolates unique values, skipping blank cells. Range B7:B57 counts the number of times that the corresponding entry in column A appears in the Blob output range. Conditional formatting is then applied to B7:B57 so that the largest numbers are green, the middle range is yellow and the smallest numbers are red.
As I explained in earlier posts, this worksheet could be expanded to cover more strings by inserting rows above row 4 and filling down the formulas from B3:S3. You could also add rows to the output calculations by inserting rows above row 57 and filling down in columns A and B, but beware complications with the array formula. If you need to expand the output range, it may be easier to select cell A7, click into the formula bar, select/copy the full text of the formula, hit escape, then select the entire range from A7 to A(whatever row is now the last row), click in the formula bar again, paste the formula you just copied, and hit CTRL-SHIFT-ENTER.
There are no named ranges in this file. It was created in English on a Windows PC using Microsoft® Excel® for Microsoft 365 MSO (16.0.14326.20706) 64-bit. Functionality on older versions of Excel or other operating systems were not tested. This proposed solution comes with no guarantees or warranties, either expressed or implied. Nor, apparently, does my ability to post proposed solutions to this forum, so perhaps this post will be instantly deleted by the mods and never be seen or benefit anyone. But that is now in the hands of the mrexcel forum gods. I am but a simple forum member.