+ Reply to Thread
Results 1 to 7 of 7

Combining IF, ISERROR, and possibly OR or AND functions

  1. #1
    Registered User
    Join Date
    08-01-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2016
    Posts
    23

    Combining IF, ISERROR, and possibly OR or AND functions

    I need help combining multiple functions in a cell to always return a null if any of the conditions are null or result in an error.

    I have data in column B, if I do a vlookup in column C to an array that sits elsewhere I want any errors (#N/A) to display as null - I can do that. If a particular row in column B is blank then I want the vlookup result to also display as null - I can do that.

    But I can't figure out how to combine them, whether it's an OR or AND function combined with IF and ISERROR or something else entirely.

    I think the attached sample spreadsheet will illustrate better what I'm trying to get at. Thanks in advance for the help.
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Combining IF, ISERROR, and possibly OR or AND functions

    In Excel 2007 you can use IFERROR function like this in row 5 copied down

    =IFERROR(VLOOKUP(B5,K$4:L$9,2,0),"")
    Audere est facere

  3. #3
    Registered User
    Join Date
    08-01-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2016
    Posts
    23

    Re: Combining IF, ISERROR, and possibly OR or AND functions

    The unfortunate bit is that I'm on 2003.

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Combining IF, ISERROR, and possibly OR or AND functions

    From your example i couldn't really work out what you wanted but is this close?
    =IF(B5="","Null",IF(ISERROR(VLOOKUP(K5,B5:E10,1,FALSE)),"Null",VLOOKUP(K5,B5:E10,1,FALSE)))

  5. #5
    Registered User
    Join Date
    08-01-2011
    Location
    Denver, CO
    MS-Off Ver
    Excel 2016
    Posts
    23

    Re: Combining IF, ISERROR, and possibly OR or AND functions

    With the correct cell references...that's it!! I was using that but kept adding an obscene amount of parentheses so it wouldn't work for me yesterday.
    Here's my result if anyone is interested. =IF(B5="","",IF(ISERROR(VLOOKUP(B5,$K$4:$L$9,2,FALSE)),"",VLOOKUP(B5,$K$4:$L$9,2,FALSE)))

    Thank you, thank you, thank you!

  6. #6
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: Combining IF, ISERROR, and possibly OR or AND functions

    Lol, your welcome!

  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,705

    Re: Combining IF, ISERROR, and possibly OR or AND functions

    Quote Originally Posted by loumarday View Post
    Here's my result if anyone is interested. =IF(B5="","",IF(ISERROR(VLOOKUP(B5,$K$4:$L$9,2,FALSE)),"",VLOOKUP(B5,$K$4:$L$9,2,FALSE)))
    I would suggest using ISNA instead of ISERROR, as that will mask all errors.

    Here's another way that avoids using the VLOOKUP formula twice:

    =IF(B5="","",IF(COUNTIF($K$4:$L$9,B5)=0,"",VLOOKUP(B5,$K$4:$L$9,2,FALSE)))

    Hope this helps.

    Pete

+ 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