+ Reply to Thread
Results 1 to 10 of 10

Find that the text has repeating pattern

  1. #1
    Registered User
    Join Date
    10-13-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Exclamation Find that the text has repeating pattern

    Hi,

    I need to identify if a column text has a repeating pattern, how can I go about creating a formula?
    The sample text is, Abcabc!abc123 dur to abc repeating this string should be marked.

    Does anybody know a formula for this problem?

    Regards
    Jaffar

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Find that the text has repeating pattern

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

    Drill down
    Frob first, tweak later

  3. #3
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Find that the text has repeating pattern

    Unless you mean any string repeat, in which case you must specify the limit.
    AAbAAn (is this a repeat of AA, or does it have to be 3 characters?)

  4. #4
    Registered User
    Join Date
    10-13-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Find that the text has repeating pattern

    It can be two, three or even 4 characters but not more than four.

  5. #5
    Registered User
    Join Date
    10-13-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Find that the text has repeating pattern

    However, we do not know it can be Abc or Cbc1cbc also. So how formula does not know which pattern is repeating to start with.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,925

    Re: Find that the text has repeating pattern

    Does it have to be a single formula? If I break it up into simple steps, I see:

    1) MID() function to extract all 3 character (or other length character) blocks of text from the main text string.
    2) COUNTIF() function to see if there is more than one of any of the blocks of text

    If any of the results of 2 is greater than 1, then you have a repeated block of text. If all of the results of 2 are 1, then there is no repeated block.
    Attached Files Attached Files
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Registered User
    Join Date
    10-13-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Find that the text has repeating pattern

    Thanks MrShorty and Neil.
    I guess I need to combine the COUNTIF() and MID() functions together to get the final combined function, however, if I have to address all cases then the formula will be very long.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,988

    Re: Find that the text has repeating pattern

    Try this ...

    =IFERROR(LOOKUP(2,1/(LEN(A1)-LEN(SUBSTITUTE(UPPER(A1),MID(UPPER(A1),ROW(INDIRECT("$1:"&(LEN(A1)-2))),3),""))>3),MID(A1,ROW(INDIRECT("$1:"&(LEN(A1)-2))),3)),"")
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-13-2016
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Find that the text has repeating pattern

    Thanks Phuocam that works for me!

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2021
    Posts
    5,988

    Re: Find that the text has repeating pattern

    You're welcome.

+ 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. Need help repeating a pattern spanning multiple cells
    By tcdawg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-15-2016, 09:14 AM
  2. Repeating pattern problem
    By INSIDEOUTE in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-27-2015, 02:36 PM
  3. Formula to find pattern of characters in text
    By igoodable in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2014, 10:44 AM
  4. Autofill a pattern or repeating sequence
    By awcwa in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 12:04 PM
  5. Repeating sequential pattern
    By Bdown in forum Excel General
    Replies: 3
    Last Post: 06-07-2012, 05:13 PM
  6. Excel 2007 : repeating pattern interlinked among columns
    By Blakespops in forum Excel General
    Replies: 0
    Last Post: 10-30-2011, 07:18 PM
  7. [SOLVED] repeating a data pattern in excel
    By KelC in forum Excel General
    Replies: 1
    Last Post: 08-01-2005, 04:05 PM

Tags for this Thread

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