+ Reply to Thread
Results 1 to 10 of 10

Highlight cells that have matching sequences of letters?

  1. #1
    Registered User
    Join Date
    10-24-2020
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    16

    Question Highlight cells that have matching sequences of letters?

    I have tens of thousands of rows in one column with either the letter A or the letter B randomly. They're all separated into groups of 6 rows with a blank cell in between them. What I'm trying to do is, I want to highlight wherever there are 3 consecutive groups of 6 with exactly the same sequence of A or B as each other, if that makes sense.

    Can this be done?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Highlight cells that have matching sequences of letters?

    Can you provide a small sample WB showing what you are working with?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-24-2020
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    16

    Re: Highlight cells that have matching sequences of letters?

    Have attached an example.

    Rows 22 to 41 in the A column would be what I would like highlighted.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-24-2020
    Location
    New Zealand
    MS-Off Ver
    2019
    Posts
    16

    Question Re: Highlight cells that have matching sequences of letters?

    Any ideas?

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,943

    Re: Highlight cells that have matching sequences of letters?

    Administrative Note:

    We don't expect you to bump threads sooner than 24 hours after your last post and then no more than once a day - it has been only a couple of hours since you posted. Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Contributor
    Join Date
    09-03-2016
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2019
    Posts
    164

    Re: Highlight cells that have matching sequences of letters?

    Hello
    One solution could be this code
    Please Login or Register  to view this content.
    Let them know.
    Hello,
    Mario

  7. #7
    Forum Contributor
    Join Date
    09-03-2016
    Location
    Catania, Italy
    MS-Off Ver
    Excel 2019
    Posts
    164

    Re: Highlight cells that have matching sequences of letters?

    Hello
    I misunderstood. I think this code is more suitable for your needs.
    Please Login or Register  to view this content.
    Hello,
    Mario

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Highlight cells that have matching sequences of letters?

    Please try CF formula applies to A1:A60

    =(SUBSTITUTE(CONCAT(OFFSET(A$1,FLOOR(ROWS(A$1:A1),21),,20)),CONCAT(OFFSET(A$1,FLOOR(ROWS(A$1:A1),21),,6)),)="")*(A1<>"")
    Attached Files Attached Files

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Highlight cells that have matching sequences of letters?

    Quote Originally Posted by Bo_Ry View Post
    Please try CF formula applies to A1:A60

    =(SUBSTITUTE(CONCAT(OFFSET(A$1,FLOOR(ROWS(A$1:A1),21),,20)),CONCAT(OFFSET(A$1,FLOOR(ROWS(A$1:A1),21),,6)),)="")*(A1<>"")
    Im sure there are many of us (myself included) that would love to know exactly what that formula does - any chance of an explanation?

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Highlight cells that have matching sequences of letters?

    Ok, I'll try.

    First, I can use volatile function as CF is already volatile.

    a. FLOOR(ROWS(A$1:A1),21) give 0, 21 , 42 on every 21 row

    b. CONCAT(OFFSET(A$1,FLOOR(a,,6)) to get pattern of 6 row,

    c. CONCAT(OFFSET(A$1,FLOOR(a,,20)) to get pattern of 6 row x3 ,

    d. SUBSTITUTE(c(6x3),b(6),) substitute pattern of 6 row x3 with pattern of 6 row with null string

    e. d="" if result is null string. this mean pattern of 6 row is the same for pattern of 6 row x3


    ** Then I notice that I only check every 0, 21 , 42 I need to add every 7, 28 , 49 and 14, 35, 56

    and also need to check if the 6x3 has data, COUNTA(OFFSET(A$1,FLOOR(ROWS(A$1:A1),21),,20)>17

    so new long and painful CF formula


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Highlight to separate the cells containing numbers and letters
    By Dr. Shivaji Saha in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-15-2021, 05:41 AM
  2. [SOLVED] detect each corresponding number and highlight a color the sequences 2,3,4,5,6,7 .....
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2020, 05:06 PM
  3. Macro - missing sequences starting by letters
    By vendam in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-12-2015, 02:26 PM
  4. [SOLVED] Highlight matching cells in at least 2 arrays
    By MelB83 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-21-2015, 07:50 PM
  5. Replies: 16
    Last Post: 11-09-2014, 08:32 PM
  6. Highlight cells without capital letters
    By zincoxide in forum Excel General
    Replies: 3
    Last Post: 10-04-2013, 04:24 AM
  7. Replies: 5
    Last Post: 09-05-2013, 08:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1