+ Reply to Thread
Results 1 to 6 of 6

IF with VLOOKUP

  1. #1
    Registered User
    Join Date
    06-12-2015
    Location
    Wolverhampton, England
    MS-Off Ver
    2007
    Posts
    19

    IF with VLOOKUP

    Hi.

    Noobie to the forum here. I'm having issues with combining IF with VLOOKUP. My formula is as follows:

    =IF(VLOOKUP(I2,J:J,1,FALSE)=I2,"OK",I2)

    The True section of the IF statement returns "OK" as prescribed, however, the False section returns #N/A instead of the contents of I2. I'm then using the adjacent collumn with an ISNA function to get the result I wanted in the first place:

    =IF(ISNA(K2)=TRUE,I2,"")

    This seems a convoluted approach and I'd like to see what I'm doing wrong rather than use this workaround. I'm very much self taught when it comes to Excel and any help would be greatly apprreciated.

    Regards all,

    James

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: IF with VLOOKUP

    Try this:

    =IF(ISNA(VLOOKUP(I2,J:J,1,FALSE)),I2,"OK")
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF with VLOOKUP

    Try

    =IF(ISNA(MATCH(I2,J:J,0)),I2,"OK")

    Or without the need to trap errors

    =IF(COUNTIF(J:J,I2),"OK",I2)

  4. #4
    Registered User
    Join Date
    06-12-2015
    Location
    Wolverhampton, England
    MS-Off Ver
    2007
    Posts
    19

    Re: IF with VLOOKUP

    Thanks both. Glenn's answer worked. Kind of obvious when you think about it but it had me stumped!

    Really grateful. Have a good day

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: IF with VLOOKUP

    Nothing's obvious - if you can't see it!! Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

  6. #6
    Registered User
    Join Date
    06-12-2015
    Location
    Wolverhampton, England
    MS-Off Ver
    2007
    Posts
    19

    Re: IF with VLOOKUP

    All done ; )

+ 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. Using vLookup based on results from a vLookup & returning an undetermined list
    By NormalityBan in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-14-2014, 05:02 AM
  2. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  3. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  4. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  5. Replies: 5
    Last Post: 07-29-2009, 07:53 AM

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