Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VLOOKUP question?

Status
Not open for further replies.

redwolfe

MIS
Jan 12, 2000
89
US
If the vlookup function returns #N/A, how can I either display a message or leave the cell blank?
 
Try this:

=IF(ISERROR(VLOOKUP(A1,info,2,0)),"Error",VLOOKUP(A1,info,2,0))

substituting your data and ranges, of course.
 
more specifically:

IF(ISNA(VLOOKUP(A1,info,2,0)),"No Match",VLOOKUP(A1,info,2,0))


Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
You could also download/install the morefunc.xll addin by Laurent Longre and use ...


=IF(ISNA(SETV(VLOOKUP(data,lookup_range,col,type))),"ERROR",GETV())

-----------
Regards,
Zack Barresse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top