Returning an alternative value if lookup cannot be found in array

  • Thread starter Queen_Of_Thebes
  • Start date
Q

Queen_Of_Thebes

I think I need to use an IF statement but I'm not sure how to do it ...

This is my current formula
=VLOOKUP(A6,Pricing!C1:D1871,2,0)

If this value, A6, cannot be found in the array I get the following returned
#N/A
If #N/A is returned I want Excel to put 0 (zero)

How do I do that please?
 
P

Pete_UK

Like this:

=IF(ISNA(VLOOKUP(A6,Pricing!C1:D1871,2,0)),0,VLOOKUP(A6,Pricing!
C1:D1871,2,0))

Hope this helps.

Pete
 
Q

Queen_Of_Thebes

Many thanks, this has worked a treat :)

Pete_UK said:
Like this:

=IF(ISNA(VLOOKUP(A6,Pricing!C1:D1871,2,0)),0,VLOOKUP(A6,Pricing!
C1:D1871,2,0))

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top