+ Reply to Thread
Results 1 to 15 of 15

IF, ISERROR and double VLOOKUP

Hybrid View

  1. #1
    Registered User
    Join Date
    10-10-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    42

    Lightbulb IF, ISERROR and double VLOOKUP

    Can some one explain this formula to me in plain english? I don't understand why the ISERROR function is being used, or why VLOOKUP is in there twice.

    Formula: =IF(ISERROR(VLOOKUP(J6,V:W,2,FALSE)),"",VLOOKUP(J6,V:W,2,FALSE))

    Thanks!
    Last edited by myshadeofglory; 10-21-2011 at 09:14 AM. Reason: Added formula

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: IF, ISERROR and double VLOOKUP

    You have not mentioned where....i dont see any iserror or double vlookup. Please explain or attach a file.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: IF, ISERROR and double VLOOKUP

    I'm taking a guess here as you haven't posted your formula, but it sounds like you're describing the 2003 way of removing the error if there is no match. The first part of the formula tests to see if the v lookupis an error, if it is it displays nothing, if not it returns the valie of the second vlookup

  4. #4
    Registered User
    Join Date
    10-10-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: IF, ISERROR and double VLOOKUP

    That's quite likely, Kyle123. You said 2003 though. Does 2007 offer a different solution?

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: IF, ISERROR and double VLOOKUP

    I believe there are some If Error tests in 07 and later that make this obsolete. I don't have any of these versions though but I'm someone can clarify

  6. #6
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IF, ISERROR and double VLOOKUP

    Yes, instead of the duplication of the formula, in 2007 onwards you can simply use:

    =IFERROR(VLOOKUP(J6,V:W,2,FALSE),"")

    However, be aware that these formulas aren't backwards compatible, so you may have problems if anyone ever needed to use/view the spreadsheet on an earlier version.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF, ISERROR and double VLOOKUP

    In 2007, you can use IFERROR and process the VLOOKUP once only..

    e.g

    =IFERROR(VLOOKUP(J6,V:W,2,FALSE),"")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  8. #8
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IF, ISERROR and double VLOOKUP

    The VLOOKUP formula is in twice because the first use determines if it returns an error (normally a #N/A error with VLOOKUP). If it is then the ISERROR allows a controlled response to be given.

    The second VLOOKUP (once it has been confirmed that it's not going to fail) actually returns the required value.

    In Excel 2007 you can shorten the formula to =IFERROR(VLOOKUP(J6,V:W,2,FALSE),"")

  9. #9
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IF, ISERROR and double VLOOKUP

    Wow, second time today - it's like we're working in triplicate today guys!

  10. #10
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IF, ISERROR and double VLOOKUP

    Quote Originally Posted by brokenbiscuits View Post
    Wow, second time today - it's like we're working in triplicate today guys!
    I just follow NBVC round, paraphrasing all of his posts, in the hope that newbies think that I know what I'm talking about

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: IF, ISERROR and double VLOOKUP

    I tried the same formula above in 2007 and it still works.

  12. #12
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: IF, ISERROR and double VLOOKUP

    Quote Originally Posted by arlu1201 View Post
    I tried the same formula above in 2007 and it still works.
    There's no problem using that formula in 2007, it's just neater and (slightly) quicker to use the IFERROR function.

  13. #13
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: IF, ISERROR and double VLOOKUP

    hehehe if only you could make his formulas shorter too (into something I can follow), then I'd be really impressed

  14. #14
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,792

    Re: IF, ISERROR and double VLOOKUP

    Quote Originally Posted by Kyle123 View Post
    hehehe if only you could make his formulas shorter too ......
    =IFERROR(VLOOKUP(J6,V:W,2,0),"")

    simples....
    Audere est facere

  15. #15
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: IF, ISERROR and double VLOOKUP

    Oooh I see, it makes so much sense now, don't know why I didn't see it before!!

    Thanks dll

+ 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