+ Reply to Thread
Results 1 to 18 of 18

Find repeating patterns in a range of data

  1. #1
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Find repeating patterns in a range of data

    Finding the same team of 4 out of 10 horses, to keep track of different teams during chuckwagon race season. I have the names of 10 horses in a column, then the next 30 columns are the race dates, if a horse is on the team of 4 that races that day, a racing time is entered into it's corresponding row. Anyway to find repeating sets of the same team of 4 horses and return its team name or recognize a new team and assign a new team name?

  2. #2
    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,914

    Re: Find repeating patterns in a range of data

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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.

  3. #3
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    Here is an example spreadsheet
    Attached Files Attached Files

  4. #4
    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,914

    Re: Find repeating patterns in a range of data

    Would you have a problem with a helper row?

  5. #5
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    Not at all, whatever works, thanks!

  6. #6
    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,914

    Re: Find repeating patterns in a range of data

    How many rows could there be (maximum), and how many teams?

    I'm not quite clear how you expect the sheet to be populated - which cells in row 2 are you expecting to be populated manually and which automatically? Or does Excel have to do it all, creating names for teams as it goes?

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find repeating patterns in a range of data

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Race 1 Race 2 Race 3 Race 4 Race 5 Race 6 Race 7
    2
    Team Number
    15
    113
    153
    774
    209
    153
    209
    B2: =SUMPRODUCT(ISNUMBER(B5:B14) * 2^(ROW($A$5:$A$14) - ROW($A$5)))
    3
    Team Name Team A Team B Team C Team D Team E Team C Team E B3: =IF(COUNTIF($A2:A2, B2) = 0, "Team " & CHAR(63 + SUMPRODUCT(1/COUNTIF(rng, rng))), INDEX($A3:A3, MATCH(B2, rng, 0)))
    4
    5
    Sky
    01:18.72
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    6
    Tommy
    01:18.72
    01:19.26
    7
    Reese
    01:18.72
    01:19.26
    8
    Ben
    01:18.72
    01:18.14
    01:18.14
    9
    Kyle
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    10
    JB
    01:18.54
    11
    Mickey
    01:18.54
    01:18.54
    01:16.64
    12
    Frankie
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    13
    Bob
    01:19.26
    14
    Don
    01:19.26
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    Quote Originally Posted by AliGW View Post
    How many rows could there be (maximum), and how many teams?

    I'm not quite clear how you expect the sheet to be populated - which cells in row 2 are you expecting to be populated manually and which automatically? Or does Excel have to do it all, creating names for teams as it goes?

    Maximum 50 races, so if each race had a different team (not likely) then max 50 different teams.
    Maximum 20 rows (different horses)
    I would like excel to do it automatically, search each race column and if it recognizes the same team put the existing team name in the cell, if it is a new combination team, then assign a new team name and put it in the cell.

  9. #9
    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,914

    Re: Find repeating patterns in a range of data

    You have a solution offered in post #7 - I think it does what you want.

  10. #10
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    Even assigning each team a unique number works, doesn't have to be "Team A", that was just a quick choice from me. So on your solution if each team gets a number,like in your row 2, i can work with that.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find repeating patterns in a range of data

    Oops -- left a named range in there:

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Race 1 Race 2 Race 3 Race 4 Race 5 Race 6 Race 7
    2
    Team Number
    15
    113
    153
    774
    209
    153
    209
    B2: =SUMPRODUCT(ISNUMBER(B5:B14) * 2^(ROW($A$5:$A$14) - ROW($A$5)))
    3
    Team Name Team A Team B Team C Team D Team E Team C Team E B3: =IF(COUNTIF($A2:A2, B2) = 0, "Team " & CHAR(63 + SUMPRODUCT(1/COUNTIF($A$2:B$2, $A$2:B$2))), INDEX($A3:A3, MATCH(B2, $A$2:B$2, 0)))
    4
    5
    Sky
    01:18.72
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    6
    Tommy
    01:18.72
    01:19.26
    7
    Reese
    01:18.72
    01:19.26
    8
    Ben
    01:18.72
    01:18.14
    01:18.14
    9
    Kyle
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    10
    JB
    01:18.54
    11
    Mickey
    01:18.54
    01:18.54
    01:16.64
    12
    Frankie
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    13
    Bob
    01:19.26
    14
    Don
    01:19.26

  12. #12
    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,914

    Re: Find repeating patterns in a range of data

    In that case, maybe all you need is this, then? Adapted from SHG's suggestion:

    ="Team "&SUMPRODUCT(ISNUMBER(B5:B14) * 2^(ROW($A$5:$A$14) - ROW($A$5)))

  13. #13
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    I will try it, looks very promising thanks so much for the help!!

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find repeating patterns in a range of data

    If you do that, you'll end up with some awkward team names, like "Team 1966080"
    Last edited by shg; 06-16-2018 at 02:16 PM.

  15. #15
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    hmmm anyway to get more manageable numbers?

  16. #16
    Registered User
    Join Date
    06-16-2018
    Location
    Edmonton , alberta
    MS-Off Ver
    2016 excel
    Posts
    8

    Re: Find repeating patterns in a range of data

    Tried your formula works great thanks

  17. #17
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find repeating patterns in a range of data

    If you just want the teams numbered sequentially,

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Race 1 Race 2 Race 3 Race 4 Race 5 Race 6 Race 7
    2
    Team Makeup
    15
    113
    153
    774
    209
    153
    209
    B2: =SUMPRODUCT(ISNUMBER(B5:B14) * 2^(ROW($A$5:$A$14) - ROW($A$5)))
    3
    Team Name
    Team 1
    Team 2
    Team 3
    Team 4
    Team 5
    Team 3
    Team 5
    B3: =IF(COUNTIF($A2:A2, B2) = 0, MAX($A3:A3) + 1, INDEX($A3:A3, MATCH(B2, $A$2:B$2, 0)))
    4
    Format of B3: "Team " 0
    5
    Sky
    01:18.72
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    6
    Tommy
    01:18.72
    01:19.26
    7
    Reese
    01:18.72
    01:19.26
    8
    Ben
    01:18.72
    01:18.14
    01:18.14
    9
    Kyle
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    10
    JB
    01:18.54
    11
    Mickey
    01:18.54
    01:18.54
    01:16.64
    12
    Frankie
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    13
    Bob
    01:19.26
    14
    Don
    01:19.26


    Note that the values calculated in row 3 are numbers; the "Team" part comes from the number format. You'd probably want to hide row 2 to avoid confusion.
    Last edited by shg; 06-20-2018 at 09:48 AM.

  18. #18
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find repeating patterns in a range of data

    You're welcome.

    If you have 50 events, you don't want the team names going past Z, so maybe just assign sequential numbers:

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    Race 1 Race 2 Race 3 Race 4 Race 5 Race 6 Race 7
    2
    Team Makeup
    15
    113
    153
    774
    209
    153
    209
    B2: =SUMPRODUCT(ISNUMBER(B5:B14) * 2^(ROW($A$5:$A$14) - ROW($A$5)))
    3
    Team Name
    Team 1
    Team 2
    Team 3
    Team 4
    Team 5
    Team 3
    Team 5
    B3: =IF(COUNTIF($A2:A2, B2) = 0, MAX($A3:A3) + 1, INDEX($A3:A3, MATCH(B2, $A$2:B$2, 0)))
    4
    Format of B3: "Team " 0
    5
    Sky
    01:18.72
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    6
    Tommy
    01:18.72
    01:19.26
    7
    Reese
    01:18.72
    01:19.26
    8
    Ben
    01:18.72
    01:18.14
    01:18.14
    9
    Kyle
    01:18.54
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    10
    JB
    01:18.54
    11
    Mickey
    01:18.54
    01:18.54
    01:16.64
    12
    Frankie
    01:18.14
    01:18.54
    01:18.14
    01:16.64
    13
    Bob
    01:19.26
    14
    Don
    01:19.26

+ 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] Excel finding patterns across data range
    By hazzaska in forum Excel General
    Replies: 5
    Last Post: 04-21-2017, 02:42 AM
  2. Find and Flag Missing Data Pair in a range of repeating data segments.
    By mgcarino14 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-29-2016, 09:37 AM
  3. Find Repeating Data
    By wilson33 in forum Excel General
    Replies: 4
    Last Post: 04-03-2016, 04:48 PM
  4. Find and count the patterns
    By malladiram in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 10-08-2015, 06:11 PM
  5. Scanning to find patterns in data
    By downhillbilly in forum Excel General
    Replies: 10
    Last Post: 08-04-2013, 03:42 PM
  6. Add spaces in between repeating patterns
    By bobbied in forum Excel General
    Replies: 1
    Last Post: 09-10-2010, 03:04 PM
  7. [SOLVED] HOW DO I USE MACRO TO FIND REPEATING DATA FROM ANOTHER WORKBOOK
    By John Knapczyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2005, 05:06 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