Consulting

Results 1 to 6 of 6

Thread: Match function for 2 columns

  1. #1
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location

    Match function for 2 columns

    Dear Gurus,

    I am rushing .. so any quick help is so much appreciated.
    Please how do I match the numbers from 2 cols, and it returns "N/A" for any un-match numbers. Many thanks. I attach a simple spreadsheet.

    joelle

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Quote Originally Posted by joelle
    ...Please how do I match the numbers from 2 cols, and it returns "N/A" for any un-match numbers. Many thanks. I attach a simple spreadsheet.

    joelle
    Greetings Joelle,

    For a simple formula check, try:
    =IF(B2<>C2,"N/A","Matches")
    ...in D2 and drag down.

    Does that do what you want?

    Mark

  3. #3
    VBAX Tutor joelle's Avatar
    Joined
    Apr 2005
    Location
    Sunnyvale, CA
    Posts
    204
    Location
    Hello Mark,

    The matching numbers are in random rows.
    So B2 does not match C2, but value in C2 can be in C4.

    I would like to know which ones in col C don't match any value in Col B.

    Please help. Thanks.

    joelle

  4. #4
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Okay, I'm not sure what you want to return for the ones that a match is found for, but just to check each each cell (in col c) against the array of cells in Col B, MATCH would work.

    Try:
    =MATCH(C2,$B$2:$B$10,0)
    ...in D2 and drag down.

    Is that any closer to what we're wanting?

    Mark

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    or maybe
    =COUNTIF(B:B,C2)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6

    Red face

    Apologies Big Guru's of vba - n sorry for butting in

    But... I tried this the old fashioned way using ISRROR & VLOOKUP

    Hope this method helps joelle....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •