ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet function Vlookup (https://www.excelbanter.com/excel-programming/344838-worksheet-function-vlookup.html)

Antonis

Worksheet function Vlookup
 
Hi,

I am using the vlookup function so that I can find prices of various
products. I want to make vlookup to search from bottom to top and not the
other way around.

How can I do that?

Thanks in advance,

Antonis.

Nigel

Worksheet function Vlookup
 
AFAIK you cannot, the only possible option would be to pre-sort the list in
reverse order. If you do not have a column that will obviously sort the
list then add a helper column, fill it with a numerical sequence and sort
that in descending order.

--
Cheers
Nigel



"Antonis" wrote in message
...
Hi,

I am using the vlookup function so that I can find prices of various
products. I want to make vlookup to search from bottom to top and not the
other way around.

How can I do that?

Thanks in advance,

Antonis.




Dave Peterson

Worksheet function Vlookup
 
Maybe you can use a different function:

Say your table is in Sheet2!A1:B200 and your value to look up is in sheet1!a1.

Then put this formula in B1 of Sheet1 and you'll get that last value.

=INDEX(Sheet2!B1:B200,LOOKUP(2,1/(Sheet2!A1:A200=A1),ROW(A1:A200)))

Adjust the ranges (all of them), but don't use the whole column.

Antonis wrote:

Hi,

I am using the vlookup function so that I can find prices of various
products. I want to make vlookup to search from bottom to top and not the
other way around.

How can I do that?

Thanks in advance,

Antonis.


--

Dave Peterson

Martin Fishlock[_3_]

Worksheet function Vlookup
 
Dear Antonis

You cannot get vlookup to work from bottom to top, but you could reverse the
order of your data or write a vlookup function yourself.



Antonis

Worksheet function Vlookup
 
Thank you for the immediate response.

I have sorted my data the other way around and everything works fine now.


All times are GMT +1. The time now is 03:29 AM.

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