# Combining IF, ISERROR, and possibly OR or AND functions

1. ## 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.

2. ## 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),"")

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

The unfortunate bit is that I'm on 2003.

4. ## 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. ## 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!

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

Originally Posted by loumarday
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

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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