+ Reply to Thread
Results 1 to 6 of 6

Search in multiple column cells for a pattern of 5 numbers

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Hellas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Search in multiple column cells for a pattern of 5 numbers

    Hi everyone,

    I want to create a roulette database with random numbers from 0 to 36 and split it in columns in an excel sheet.
    Example A1: 23, A2: 11, A3: 0, ... A1000: 12 then B1: 20, B2: 31, B3: 6, ... B1000: 36 etc etc
    (this part i know how it can be done)

    and then search for a specific pattern of 5 numbers in this database

    Example: Search for numbers 23,4,12,1,35
    If this pattern exists in continuous column cells then the excel points at where this numbers are (let's say D812,D813,D814,D815,D816).

    If there is a problem in splitting the columns i can put the numbers only in A column.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Search in multiple column cells for a pattern of 5 numbers

    Hi
    is this what you're after?
    run the macro recalc_find to recalc the random numbers until there is a row in columns 1-5 matching the values in cells H2:l2
    this might take a minute or two as there are 14348907 possible cominations of five numbers between 0 and 26
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    Hellas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Search in multiple column cells for a pattern of 5 numbers

    Thank you very much for your post!
    It seems a lot with what i want.

    But i will give you a better example because i might have not expressed myself correctly:

    A1: 3
    A2: 34
    A3: 2
    A4: 21
    A5: 7
    A6: 9
    A7: 0
    A8: 22
    A9: 36
    A10: 1
    A11: 22
    A12: 6
    A13: 13
    A14: 11
    ...
    A30000: 4
    etc
    etc

    So if i search for a pattern of 7,9,0 it will point the cells A5,A6,A7
    if i search for a pattern of 9,0,22,36,1,22 it will point the cells A6,A7,A8,A9,A10,A11

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Search in multiple column cells for a pattern of 5 numbers

    is this more like it? again, it may will take a minute or two

    you might want to copy the formulas in columns A and B for more rows - I kept it to 50000 to stay within the size limit for uploaded files
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-17-2012
    Location
    Hellas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Search in multiple column cells for a pattern of 5 numbers

    Fantastic! Thank you very much!!!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Search in multiple column cells for a pattern of 5 numbers

    @ leto11

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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