VLookup Enhancement

A

Alan Perkins

I have two suggestions to improve VLookup:

1. Add an optional parameter that provides a result if the Vlookup returns
NA so that you don;t need to wrap it in an If (ISNA...

2. Make the column offset capable of negative values so that you can offset
to the left of the reference column.

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...dg=microsoft.public.excel.worksheet.functions
 
B

Bob Phillips

Alan Perkins said:
I have two suggestions to improve VLookup:

1. Add an optional parameter that provides a result if the Vlookup returns
NA so that you don;t need to wrap it in an If (ISNA...


they have done that in Excel 2007 with the IFERROR function

=IFERROR(VLOOKUP(B1,K1:M10,2,FALSE),"")

2. Make the column offset capable of negative values so that you can
offset
to the left of the reference column.


Problem with that is you are the asking it to get a value from a column that
is not in lookup table, a problem It is easily simulated with

=INDEX(A;A,MATCH(lookup_value,B:C,0))
 
T

T. Valko

I like both of your suggestions but I wouldn't hold my breath hoping for
those to be implemented.

If you use excel 2007 you can use the IFERROR function to trap #N/A:

=IFERROR(VLOOKUP(A1,F1:G10,2,0),"")

Note that this will trap *all* errors, not just #N/A.

Much better than the pedantic:

=IF(ISNA(VLOOKUP(A1,F1:G10,2,0)),"",VLOOKUP(A1,F1:G10,2,0))

Another shorter alternative:

=IF(COUNTIF(F1:F10,A1),VLOOKUP(A1,F1:G10,2,0),"")

As far as the left lookup....

=INDEX(E1:E10,MATCH(A1,F1:F10,0))
 
A

Alan Beban

Alan said:
I have two suggestions to improve VLookup:
. . .
2. Make the column offset capable of negative values so that you can offset
to the left of the reference column.

If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook, you can use

=VLookupLeft

It also allows any column of the lookup array, rather than just the
lefthand column, to be used as the lookup column.

Alan Beban
 

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