+ Reply to Thread
Results 1 to 11 of 11

Match and find in adjacent cells with criteria.

  1. #1
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    449

    Lightbulb Match and find in adjacent cells with criteria.

    Hello all,

    In col BD I am wanting to find text or numbers that are exactly the same but must be in adjacent cells. I have 4 x samples in results col I.
    These samples are as follows.

    kikd
    kn
    no finish
    ulky

    In these cells the there will be all forms of text or numbers or any combination of all. No numbers in this sample.

    Most horses have 3 runs in this sheet, run number 1 2 3 col AU, some will have only have 2 or 1 run. If only 1 run, then a match can never be found.
    Col AF is their race number on the day.
    Col N is the actual race number.
    Cols B and D, 2 different dates and meetings.

    Finding the exact matches, I need must be for the same horse only, meaning they will have exactly the following 5 mentioned criteria.

    1- same date
    2- same meeting name
    3- same race number
    4- same T# there number on the day
    5- same match in adjacent cells being runs 1 and 2, 2 and 3, not 1 and 3.

    Placing an X beside these would be a good start, but a macro to find exact match after I enter what I needed would be better.

    Thanks.
    Attached Files Attached Files
    I am grateful for all answers to my questions .
    Also i give a reputation even if not answered .

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Match and find in adjacent cells with criteria.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    449

    Re: Match and find in adjacent cells with criteria.

    Thanks John can't complain about that result, more than I expected.
    If I was to only want the four sample words
    kikd
    kn
    no finish
    ulky
    And I am able to enter these four words (type of words) manually into a macro, would that be possible. This way I can change as I like.
    Thanks.

    Also getting run time error 9 on a 25,000 row sheet, this line of code in yellow.

    If InStr(1, a(i + 1, 56), v(j)) > 0 Then

    Thanks.
    Last edited by I need excel help; 09-25-2023 at 07:11 AM.

  4. #4
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    449

    Re: Match and find in adjacent cells with criteria.

    As I am getting the above error as in my post #3, I started cutting my sheets to smaller sizes, some worked on 3,200 rows and some on much much smaller sheets.
    Then I came to just one race where the macro doesn't want to go past, the only thing I can see is col BD first three cells are empty, but I tried filling them and still getting error 9.

    Got halfway thru doing manually. Grrrrrwwwww. Still happy to have a result tho.

    Noticing in col BD, when there are blank cells at the bottom of a race and blank cells at beginning of very next race error occurs. Will upload a sample of this v3.
    Last edited by I need excel help; 09-25-2023 at 08:33 PM.

  5. #5
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    449

    Re: Match and find in adjacent cells with criteria.

    Just bumping this as unanswered questions in post 4.
    Thanks.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Match and find in adjacent cells with criteria.

    Please Login or Register  to view this content.

    Issue with "kn" as you have "wknd" so a simple match on "kn" will give errors: used "kn," as a work-around.

    There may be a better solution using the "Regex" function of which I have no experience.
    Attached Files Attached Files
    Last edited by JohnTopley; 09-26-2023 at 02:05 PM.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Match and find in adjacent cells with criteria.

    Update to handle the "kn" situation:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JohnTopley; 09-26-2023 at 03:25 PM.

  8. #8
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    449

    Re: Match and find in adjacent cells with criteria.

    Thanks John, I'm working with what you have to finalize my problems.

    Can you take a look at this new sheet with your latest macro, still getting errors, different one this time.
    I'm still trying to work out problem with your post two answer.
    Thanks.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Match and find in adjacent cells with criteria.

    See attached

    Few "oddities" in the data .. "no fin" vs "no finish" ?
    Attached Files Attached Files
    Last edited by JohnTopley; 09-27-2023 at 07:00 AM.

  10. #10
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    449

    Re: Match and find in adjacent cells with criteria.

    Yes, there are many oddities in the data, bookies way of trying to trick people.
    Your post #9 has fixed the problems I mentioned in posts 4 and 8. This macro is now able to work on a 24,000-row sheet without stopping.

    Many thanks for your help and resulting answer.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Match and find in adjacent cells with criteria.

    You're welcome and thank you for the rep.

+ 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. Find match text and return multiple IDs in same cell or adjacent cells (if exist)
    By pkmlogic in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2023, 04:50 PM
  2. Find and match names on a different sheet and then copy the adjacent cells
    By windrain in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2018, 06:31 PM
  3. [SOLVED] Find Word And Set Cells To Equal Adjacent Cell Value if Criteria Is Met
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2016, 03:48 AM
  4. Highlight two adjacent cells if their sum match the criteria
    By Lucky007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-08-2015, 06:27 AM
  5. [SOLVED] Match one cell with another, if match found copy adjacent cells
    By Xiophoid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2013, 05:50 AM
  6. counting adjacent cells that match a criteria
    By chrisvacek in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-11-2012, 11:44 AM
  7. [SOLVED] Fill cells if adjacent cell match criteria
    By Jess in forum Excel General
    Replies: 6
    Last Post: 06-01-2006, 04:25 PM

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