+ Reply to Thread
Results 1 to 7 of 7

Extract the Matched Numbers from 3 Cells

  1. #1
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Extract the Matched Numbers from 3 Cells

    Hello,

    Please can someone help me about a formula?



    I have a long string with 18 numbers in different cells, so I need a formula to Extract numbers that match in 3 Different cell
    and write it in another Cell


    For example

    C:12 --> 01-02-03-07-08-10-11-15-18-20-22-26-28-31-33-36-04-06
    C:15 --> 01-02-03-07-08-10-11-15-18-20-22-26-09-12-14-17-19-21
    C:104 ->20-22-26-28-31-33-36-04-06-09-12-13-14-16-17-19-21-23


    Then I Need to Write the group of numbers that matched In Cell E:12 -> 20-22-26


    NOTE :
    I know how to extract a matched numbers from 2 Cell e.i C12 + C15 and work perfect
    using the following Formula :
    Please Login or Register  to view this content.
    i add the Cell C104 to the formula (in many ways) and won't work.
    (I Might missing something)

    The VBA for the Getmatch that i'm using, is the follow :
    Please Login or Register  to view this content.



    Thank you So much !!


    David

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extract the Matched Numbers from 3 Cells

    Hi Dave,

    Try the attached

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


    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Extract the Matched Numbers from 3 Cells

    Hi Mr Richard Buttrey

    It work as Need it, Thanks its a great code, and thanks again for your time.
    I tough it was for a lil tiny formula missing..)

    QUESTION : If i need to add a 4th Cell to take the match,(might not) do the code have to be re write it?



    Best Regards

    David

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extract the Matched Numbers from 3 Cells

    Hi,

    Yes the code would have to be re-written.
    But in that case and if the number of cells might vary, rather than adding a new section of code for every additional cell you want to include, (which is the approach I adopted here with one additional cell), it would be more elegant to include a loop in the macro so that only one section of code is needed and the loop variable would identify each successive cell that you wanted to process.

    Regards

  5. #5
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Extract the Matched Numbers from 3 Cells

    Hi Mr Richard Buttery,

    That would be nice that the Code accept up to 4 Cells, but is Okaii you've already did a lot for me

    In some cells where the GetMatch is located, i'm Getting #VALUE!, i guess it happen because it have not match in 3 Cell,
    But this is Is Okaii, it won't hurt... I'm getting what i need

    Thank you So Much Mr Richard.


    Best Regards from South Beach, Miami.



    David

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Extract the Matched Numbers from 3 Cells

    Hi,

    To get rid of the #VALUE just wrap the formula in an =IFERROR(yourformula,"No match found") function.

    Just thought of another way to process more cells which only involves the first macro. Since you currently match Cell A to Cell B and get the answer in Cell C. The logical thing to do would be take the answer in Cell C, copy it and paste it as a value to Cell A, and then copy the new data from Cell D to Cell B.

    In other words you get a match between A & B, then whatever that match results in you start with that and compare it to the next cell you want to test.

  7. #7
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: Extract the Matched Numbers from 3 Cells

    Hi Mr Richard Buttrey,

    Yes Sir, Thank you so much for your kindness.


    Best Regards

    David

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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