lookup within an IF formula

J

Jo

I want to enter a function that in cell B15 will display an empty cell if A15
is blank but otherwise looks up information from a named range in another
worksheet. I've got as far as clicking into B15 and putting in
=if(A15,"","",=vlookup(

The range is on a worksheet called "items" as follows:
A3 B3 C3 D3 E3 F3
D001 Dijon Wall Unit Vanilla Gloss 300 £137.99

Jo
 
T

T. Valko

looks up information from a named range in another worksheet

Try something like this:

=IF(A15="","",VLOOKUP(A15,named_range,column_index_number,0))
 
T

Thomas [PBD]

Jo,

Remove the =vlookup and place VLOOKUP, also place the qualifier on the
variable for your IF, where A15 = "".

The IF format is:
IF(<qualifying response>,<if true>,<if false>)

The VLOOKUP format is:
VLOOKUP(<value>,<range>,<column number>,<true/false>)

So:
=if(A15="","",vlookup(.....))
 
P

Pete_UK

You don't explain what data you want to return, so I'll assume that
you want all of it if there is a match. So, in B15 you can continue
with your formula:

=IF($A15="","",IF(ISNA(MATCH($A15,items!$A:$A,
0)),"absent",VLOOKUP($A15,items!$A:$F,COLUMN(B$1),0)))

then you can copy this formula into C15:F15 to return all the data
associated with the code that you enter in A15. You can change
"absent" to "" or some other message if you like.

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