Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the VLOOKUP function and I have this function =VLOOKUP(B9,Products!A5:K29,11,FALSE)

It works but what do I need to add so the cell will display nothing if B9 is nothing? At the moment if B9 is nothing it displays "#N/A". Thank you.

share|improve this question

migrated from Aug 1 '12 at 2:59

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

You can surround the whole thing with an if statement thus:


with any suitable changes to the B9="" condition.

That way it gives you "" if B9 is "" otherwise it gives you the result of the lookup.

share|improve this answer
Oh thank you, I didnt realize that you can use other functions within a function. – jay Oct 18 '11 at 2:22
@jay: yes, in my early days (before I knew about things like lookups), you used to find monstrosities in my spreadsheets like =if(b1="", if(b2="", if(b3="", if(b4="", if(b5="", "?", b5), b4), b3), b2), b1) :-) – paxdiablo Oct 18 '11 at 2:25
Haha I see. Hey man I applied this formula to every cell in the column but how do I make A5:K29 default? It changes as you down the column. – jay Oct 18 '11 at 2:29
@jay, you need to make the range non-relative, something like: $A$5:$K$29. That will lock the values no matter where you move or copy the formula to (you can also independently set row and column non-relative but you probably don't need that in this case). – paxdiablo Oct 18 '11 at 2:30
Jay, use absolute references, ie =IF(B9="","",VLOOKUP(B9,Products!$A$5:$K$29,11,FALSE)) [dang, damn this doubling up] – brettdj Oct 18 '11 at 2:31

For your question as asked


Going a step further in case your value in B9 does not exist in your lookup range =IF(B9="","",IF(ISNA(VLOOKUP(B9,Products!A5:K29,11,FALSE)),"Not found",VLOOKUP(B9,Products!A5:K29,11,FALSE)))

Useful reference. Patrick Matthews (MVP Excel), Six Reasons Why Your VLOOKUP or HLOOKUP Formula Does Not Work

[The other post wasn't flagged to me at the time when I posted, that said I do recommend the additional ISNA test that I added]

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.