+ Reply to Thread
Results 1 to 13 of 13

Vlookup using two values

Hybrid View

  1. #1
    Registered User
    Join Date
    05-17-2017
    Location
    Maidstone,England
    MS-Off Ver
    MS Office 2013
    Posts
    8

    Vlookup using two values

    Hi All

    Hope anyone can help, I need to do a look-up between four cells

    A1 A2 A3 A4
    1234 10 1234 10

    I would like to be able to lookup A1 and A2 and compare it against A3 & A4 and if cells a1 and a2 do not match cell a3 and a4 then it will bring up an n/a. I can write the lookup if it was just cell a1 for example but i've no idea how to do a lookup which includes a1&a2 against a3&a4 any ideas anyone?

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Vlookup using two values

    Try

    =IF(AND(A1=A3,A2=A4),"Match",NA())

  3. #3
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Vlookup using two values

    Quote Originally Posted by 63falcondude View Post
    Try

    =IF(AND(A1=A3,A2=A4),"Match",NA())
    That's where my assumption was going as well... Just not sure if that is the intention - But I agree this is what it sounds like
    -If you think you are done, Start over - ELeGault

  4. #4
    Registered User
    Join Date
    05-17-2017
    Location
    Maidstone,England
    MS-Off Ver
    MS Office 2013
    Posts
    8

    Re: Vlookup using two values

    so if A and B match C&D then its ok

    but if A & B dont match C&D then its not and visa versa. Any ideas?

  5. #5
    Registered User
    Join Date
    05-17-2017
    Location
    Maidstone,England
    MS-Off Ver
    MS Office 2013
    Posts
    8

    Re: Vlookup using two values

    so if A and B match C&D then its ok

    but if A & B dont match C&D then its not and visa versa. Any ideas?

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Vlookup using two values

    Quote Originally Posted by bodled View Post
    I'm messing this up sorry, so looking at the graphic above in this case I would need A2 & B2 to return an "OK" if they can find identical cells in rows D & E thats more like it
    See post #7.
    Last edited by 63falcondude; 05-26-2017 at 10:40 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Vlookup using two values

    The OP sample is indicating that they want to be able to rule out matches from both sets. Left to right and right to left... but they will NOT be in the same row if you look at the sample data in which "OK" is indicated when they are not aligned... To which again I say utilize what I provided and you should be good to go.
    Last edited by ELeGault; 05-26-2017 at 10:39 AM. Reason: - Removed Gender assumption

  8. #8
    Registered User
    Join Date
    05-17-2017
    Location
    Maidstone,England
    MS-Off Ver
    MS Office 2013
    Posts
    8

    Re: Vlookup using two values

    I'm messing this up sorry, so looking at the graphic above in this case I would need A2 & B2 to return an "OK" if they can find identical cells in rows D & E thats more like it

  9. #9
    Registered User
    Join Date
    05-17-2017
    Location
    Maidstone,England
    MS-Off Ver
    MS Office 2013
    Posts
    8

    Re: Vlookup using two values

    I think that "if" has worked more or less, thanks everyone :-)

  10. #10
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Vlookup using two values

    Do they need to be in the same order? Can you create a small sample book... I think I am about to make some assumptions that may lead to something that you are not actually doing.

    Just provide a small sample set as if it was in your data (Mock data) but in the same layout. Copy that and create a second sheet showing what you would like it to do through the formula... meaning if this is all in columns ABCD and you want E to display N/A when they do not match that will help us provide a solid solution.

    Thanks

  11. #11
    Registered User
    Join Date
    05-17-2017
    Location
    Maidstone,England
    MS-Off Ver
    MS Office 2013
    Posts
    8

    Re: Vlookup using two values

    Capture.JPG

    I think this is what im trying to achieve, if anyone has any bright sparks then great

  12. #12
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Vlookup using two values

    Okay, So you are saying they are not always paired side by side...
    C2 Put this and drag down
    =IF(Countifs($D:$D,$A2,$E:$E,$B2)>0,"ok","N/A")
    F2 Put this and drag down
    =IF(Countifs($A:$A,$D2,$B:$B,$E2)>0,"ok","N/A")
    Should just about do that

  13. #13
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Vlookup using two values

    Correct - Try the solutions I provided previously, they should do the trick. You just need to enter them in the specific cells I listed and then drag the formulas down.

+ 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. [SOLVED] vba vlookup table values and compare to values listed in Column B
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-26-2016, 08:34 AM
  2. Replies: 13
    Last Post: 10-13-2014, 02:00 AM
  3. Replies: 1
    Last Post: 04-30-2014, 05:49 PM
  4. [SOLVED] Vlookup is not working and giving =vlookup(B2,$T$2:$U$135,2,false) this kind of values.
    By yogeshsharma1981 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2013, 04:08 PM
  5. Replies: 3
    Last Post: 04-24-2013, 05:33 PM
  6. Replies: 1
    Last Post: 04-24-2013, 05:21 PM
  7. Replies: 2
    Last Post: 09-14-2010, 10:49 PM

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