+ Reply to Thread
Results 1 to 5 of 5

How to compare two columns and enter 3rd value if matched

  1. #1
    Registered User
    Join Date
    12-20-2009
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    2

    How to compare two columns and enter 3rd value if matched

    Hi

    I hope the title is too ambigous.

    I would like to compare two columns of different lengths and when they match enter the value from a third column.

    In the example (attached) I want to compare each instance in colum a against the larger number of examples in column d and where the two match enter the value from column b in column e.

    I have an annoying suspicion I have done this successfully in the past, but now I can't remember how.

    NB. inreality a has 28 different values and d has these values repeated 18 times, so nested ifs aren't possible. Also a and b are on one sheet and d on another.

    thanks
    Attached Files Attached Files
    Last edited by Archimedes; 12-20-2009 at 02:33 PM. Reason: forum guidelines - oops, sorry
    https://t.me/pump_upp

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to compare two columns and enter 3rd value if matched

    Welcome to the forum.

    If you want help with spreadsheets, please post spreadsheets and not pictures.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: How to compare two columns and enter 3rd value if matched

    Hi Archimedes,

    this one in E2 and copy down

    =IF(ISNA(MATCH(D2,$A$2:$A$11,0)),"",VLOOKUP(D2,$A$2:$B$11,2,FALSE))

    or

    =IF(ISNA(MATCH(D2,$A$2:$A$11,0)),"",INDEX($B$2:$B$11,MATCH(D2,$A$2:$A$11,0)))
    Last edited by teylyn; 12-20-2009 at 03:59 PM.

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

    Re: How to compare two columns and enter 3rd value if matched

    I hope the title is too ambigous
    . i think thats a tad wrong !
    do you just want to match everything in col d against col a?

    =VLOOKUP(D2,$A$2:$B$11,2,FALSE)
    "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

  5. #5
    Registered User
    Join Date
    12-20-2009
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2016
    Posts
    2

    Re: How to compare two columns and enter 3rd value if matched

    Thank you both, as both of soultions work. You've have saved me a great deal of effort.

+ 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