+ Reply to Thread
Results 1 to 8 of 8

Vlookup

  1. #1
    Registered User
    Join Date
    01-17-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    23

    Vlookup

    Hi all,

    This one may seem like an easy one to most but its causing me some grief none the less!

    Here is the scenario... I Need to lookup a cell value in a dataset on another sheet (Book) and return Y if its there, N if it isnt. So here is the formula i typed..

    =IF(VLOOKUP(A1,Book!G:G,1,0),"Y","N")

    This works fine if the value IS on the other sheet, but it returns #N/A if its not. Does this formula require an ISERROR function?

    Could somebody assist me on this as ISERROR is a new one for me.

    Thanks & Regards
    Richard
    Last edited by RickCov; 02-24-2012 at 09:56 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,861

    Re: Vlookup

    Hi Rick,

    try it this way:

    =IF(ISNA(VLOOKUP(A1,Book!G:G,1,0)),"N","Y")

    then it will be compatible with earlier versions of Excel.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-17-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Vlookup

    Pete,

    This works like a charm, Thank you so much!!

    Rick

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,861

    Re: Vlookup

    You're welcome, Rick - thanks for feeding back. You could have used MATCH if you are just looking for the existence in the other sheet:

    =IF(ISNA(MATCH(A1,Book!G:G,0)),"N","Y")

    or even COUNTIF:

    =IF(COUNTIF(Book!G:G,A1)=0,"N","Y")

    both of which can execute faster than VLOOKUP.

    If you are happy that this has solved your problem, could you mark the thread as Solved? Also, you can click on the "star" icon in the bottom left corner on any post that has helped you.

    Pete

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Vlookup

    In your original formula =IF(VLOOKUP(A1,Book!G:G,1,0),"Y","N"), a lookup value of 0 will yield "n" ?

    On the other hand =IF(ISNA(VLOOKUP(A1,Book!G:G,1,0)),"N","Y") will yield "y" if the lookup value is 0 ?

    Which one do you need?

  6. #6
    Registered User
    Join Date
    01-17-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Vlookup

    Hi Pete,

    Ive clicked the star, how do I mark it as solved?

    Rick

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,861

    Re: Vlookup

    Hi Rick,

    From the FAQs:

    To mark your thread solved do the following:
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save


    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    01-17-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Vlookup

    Pete,

    This has now been "Solved"

    Rick

+ 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