Hi Antonis,
Depends on what you mean with "from bottom to top". Unfortunately you didn't
give us your formula.
If you mean the table is sorted from large to small; no problem, as long as
the 4th argument of the VLOOKUP is FALSE. You probably need that anyway,
otherwise you will get a misleading result if you to try to look up a
product which isn't in your list.
If you mean looking up takes too long (which could be the case if you do
many lookups in table of thousands of rows) and the product table is sorted
descending, you can do (at least) two things.
One is to sort the table ascending.
If that is not possible, you can use a combination of MATCH() and INDEX().
If you're absolutely sure you will never try to lookup a product which is
not in your list, you can use:
=INDEX(B1:B5,MATCH(E1,A1:A5,-1))
where B1:B5 is your prices, A1:A5 your product numbers and E1 the product
number to be looked up.
But I would never do that: I'd always check that the product exists:
=IF(INDEX(A1:A5,MATCH(E1,A1:A5,-1))=E1,INDEX(B1:B5,MATCH(E1,A1:A5,-1)),"WRONG
NUMBER!")
--
Kind regards,
Niek Otten
"Antonis1234" <
[email protected]>
wrote in message
news:
[email protected]...