ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   VLookup Enhancement (https://www.excelbanter.com/excel-worksheet-functions/181857-vlookup-enhancement.html)

Alan Perkins

VLookup Enhancement
 
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/comm...et.f unctions

Bob Phillips

VLookup Enhancement
 

"Alan Perkins" wrote in message
...
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. Valko

VLookup Enhancement
 
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))



--
Biff
Microsoft Excel MVP


"Alan Perkins" wrote in message
...
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/comm...et.f unctions




Alan Beban[_2_]

VLookup Enhancement
 
Alan Perkins wrote:
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


All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com