+ Reply to Thread
Results 1 to 12 of 12

Field matching formula help needed.

  1. #1
    Registered User
    Join Date
    05-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Field matching formula help needed.

    Hi guys, great forum you have here.

    I browsed through the forum looking to find a way to solve my problem, but could not find it. Maybe someone here can help me out.

    I have lots of data, and it would be impractical to do it manually. Here is an example:

    A B C D

    Game ID Game Game ID Game

    Mortal Kombat 1051 Mario
    Halo 538 Sonic
    Mario 697 Mortal Kombat
    Street Fighter 472 Street Fighter
    210 Halo
    152 FIFA
    5210 PGR


    I have a long list like this. Once list has more games than the other one, but the game id's are the same. Therefore what I need is a formula that will look at B, then find it in D, if it does find the exact match in D to output the figure in C to A.

    When the automation is finished it should look like this:

    A B C D

    Game ID Game Game ID Game

    697 Mortal Kombat 1051 Mario
    210 Halo 538 Sonic
    1051 Mario 697 Mortal Kombat
    472 Street Fighter 472 Street Fighter
    210 Halo
    152 FIFA
    5210 PGR


    I hope that all displays properly for you guys. Thank you for your time.

    Kind regards.

    Andy
    Last edited by andysmith; 05-13-2009 at 04:00 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Field matching formula help needed.

    In A2, try:

    =IF(ISNUMBER(MATCH(B2,D:D,0)),INDEX(C:C,MATCH(B2,D:D,0)),"")

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Field matching formula help needed.

    Thank you very much for the quick reply. It seems to work fine for the example I gave you, but not quite with my data which is over 3000 rows. I am wondering is it because I did not explain it properly. When I put it in my data I just get a blank box. Not even an error. The only thing I can think that is different is there are more rows in B than there is in D. Not sure how that makes a difference though.

  4. #4
    Registered User
    Join Date
    05-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Field matching formula help needed.

    OK, I found out why, its because the data on the other end has spaces in them. Blank spaces. For example 1024space, so you formula is unable to match it.

    So therefore the question now is, is there a way I can get rid of any spaces automatically?

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Field matching formula help needed.

    You can select that column and go to Data|Text to Columns... then select Next.

    Select Space and Treat Consecutive delimiters as one

    Click Finish.

  6. #6
    Registered User
    Join Date
    05-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Field matching formula help needed.

    What that seems to do is separate words. For example if its Mortal Kombat it becomes Mortal in one D and Kombat in E.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Field matching formula help needed.

    Then try this formula:

    Please Login or Register  to view this content.
    adjusting ranges to suit and then confirm it with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear, then copy it down.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Field matching formula help needed.

    did say only the column with numbers!
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Registered User
    Join Date
    05-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Field matching formula help needed.

    Quote Originally Posted by NBVC View Post
    Then try this formula:

    Please Login or Register  to view this content.
    adjusting ranges to suit and then confirm it with CTRL+SHIFT+ENTER not just ENTER. You will see { } brackets appear, then copy it down.
    I trying to understand what you are saying here. Can you make it a bit more layman please? :$

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Field matching formula help needed.

    Enter in the formula and Change the ranges D1:D100, etc.. to match the size of your database, then make sure the cell is active (i.e. cursor is in the cell somewhere). Then hold the CTRL and SHIFT keys down and press ENTER. You will see { } brackets appear around the formula.

    This is a special Array formula that requires that key combo to work.

  11. #11
    Registered User
    Join Date
    05-04-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Field matching formula help needed.

    Hi NBVC.

    Sorry for the late rely. Thanks, I managed to make your original code work. It helped a lot.

    I would like to do this in return "If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.".

    However I am not sure where?

    Thanks again :-)

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Field matching formula help needed.

    Quote Originally Posted by andysmith View Post
    Hi NBVC.

    Sorry for the late rely. Thanks, I managed to make your original code work. It helped a lot.

    I would like to do this in return "If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.".

    However I am not sure where?

    Thanks again :-)
    On any one of my posts within this thread you will see a dark blue ribbon at the top.. on the right side are some icons... click the one that represents a balance (or scale)... then selelct I approve and click ok.

+ 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