# Vlookup - + 2 conditions

1. ## Vlookup - + 2 conditions

Hi. looking to create a vlookup that will lookup the value obviously but also if blank display "NA", and also if the lookup value isn't in the look up list, display "error". currently i have the following.

=IF(ISERROR(VLOOKUP(B2,LEGEND!A:B,2,FALSE)),"NA",VLOOKUP(B2,LEGEND!A:B,2,FALSE))

2. ## Re: Vlookup - + 2 conditions

Try:

``Please Login or Register  to view this content.``

3. ## Re: Vlookup - + 2 conditions

In NBVC's formula, for the first "NA", change that to "ERROR" to suit your worded request.

4. ## Re: Vlookup - + 2 conditions

tried the formula, however its giving me NA whether its blank or has a value that isn't present in the lookup listing. tried with "error" as the first option only and blank or diff value came out as error

5. ## Re: Vlookup - + 2 conditions

This gave you errors:

=IF(ISNA(VLOOKUP(B2,LEGEND!A:B,2,0)),"ERROR",IF(VLOOKUP(B2,LEGEND!A:B,2,0)="","NA",VLOOKUP(B2,LEGEND!A:B,2,0)))

?

6. ## Re: Vlookup - + 2 conditions

My formula should try the Vlookup. If the lookup value doesn't exist, you would get "NA" or "error" if you change it... if it is there and the result would be blank, then it would return "NA", otherwise it should return the relevant result.

Can you show sample if it doesn't work that way?

see attached

8. ## Re: Vlookup - + 2 conditions

So do you want "NA" to appear if the cell in column B on sheet 'full data' is blank? We thought you meant if the return value from the VLOOKUP was a blank. If that's the case, try:

=IF(B1="","NA",IF(ISNA(VLOOKUP(B1,LEGEND!A:B,2,0)),"ERROR",VLOOKUP(B1,LEGEND!A:B,2,0)))

Fill down.

9. ## Re: Vlookup - + 2 conditions

That last one did it! thx for your help!!

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