?
Solved

add a if, if vlookup returns a blank

Posted on 2016-11-15
5
Medium Priority
?
66 Views
Last Modified: 2016-11-15
Hi Experts Using Excel 2010

i have the following formula which works fine:
IF(IF(ISNA(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0)),"",(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0)))=0,"",IF(ISNA(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0)),"",(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0))))

if the above formula returns a blank then i want to add another if statement to vlookup another parameter...i.e.

=if(IF(IF(ISNA(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0)),"",(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0)))=0,"",IF(ISNA(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0)),"",(VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,64,0))))="",vlookupetc..... other "")
0
Comment
Question by:route217
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41887956
Further details of the other parameter would help so that we can write it into the formula.

Alternatively, a sample workbook would be great.
0
 

Author Comment

by:route217
ID: 41887989
Thanks Rob

VLOOKUP($A4,'Copy of Source data'!$A$6:$ET$550,44,0)

Other lookup
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41888008
Thinking about it, the result of a lookup can only be one of the following four options:

1) error because lookup value not found
2) zero because lookup value found but lookup column is empty or zero
3) lookup result
4) blank because lookup value found and result cell contains just an apostrophe or a blank string, ie one or more spaces. This could be as a result of a formula that resulted in "" or " " being copied and pasted as values.

To be blank it would be option 4. Is that option likely to occur?
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 2000 total points
ID: 41888049
Slight re-ordering of the checks was required, checking for blank before 0 because as mentioned blank would normally return 0.

=IF(ISERROR(VLOOKUP($A4,'Copy of Source Data'!$A$6:$ET$550,64,0)),"",
IF(ISBLANK(VLOOKUP($A4,'Copy of Source Data'!$A$6:$ET$550,64,0)),VLOOKUP($A4,'Copy of Source Data'!$A$6:$ET$550,44,0),
IF(VLOOKUP($A4,'Copy of Source Data'!$A$6:$ET$550,64,0)=0,"",VLOOKUP($A4,'Copy of Source Data'!$A$6:$ET$550,64,0))))

If lookup 64 is an error then blank else if lookup 64 is blank then lookup 44 else if lookup 64 is zero then blank else lookup 64
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41888067
Adjustment to my earlier statement, result of a lookup in option 2 would normally be zero but it can be tested using the ISBLANK function.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question