Embedded If Function in a Vlookup Function

G

Guest

In an invoice I am making I want to use the vlookup function to populate a
description column and a unit price column when I type in a product item
number. I have a product table set up with the item number, description and
unit price on it. However, when I do not have an entry in the product item
numberin the invoice, an error message appears in the description column and
unit price column which does not make a good appearance for my invoice.

How to I put the =If(B15="","","") function in the vlookup function
=VLOOKUP(B15,Products,2)
 
G

Guest

=If(B15="","",VLOOKUP(B15,Products,2))

But if B15 does not appear in the products table, you will get an error
(which in this case may be desirable).
 
S

Simon Murphy

=If(B15="","",VLOOKUP(B15,Products,2))
Its often safer to use the 4 argument Vlookup set to false, unless you can
be certain your source list will be sorted :

=If(B15="","",VLOOKUP(B15,Products,2,FALSE))

cheers
Simon
 

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