Can VLookup return the LAST value in a range?

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

If I have a list:
A 10
B 3
C 5
A 8
D 6

How can I get VLookup to return to value associated with the last occurance
of A instead of the first (i.e the value 8)?
 
One way, array-entered* in say, C1
=INDEX($B$1:$B$10,MATCH(MAX(IF($A$1:$A$10="A",ROW($A$1:$A$10))),IF($A$1:$A$10="A",ROW($A$1:$A$10)),0))

*press CTRL+SHIFT+ENTER to confirm the formula

Adapt the ranges to suit
 
Max said:
One way, array-entered* in say, C1:
=INDEX($B$1:$B$10,MATCH(MAX(IF($A$1:$A$10="A",ROW($A$1:$A$10))),IF($A$1:$A$10="A",ROW($A$1:$A$10)),0))

*press CTRL+SHIFT+ENTER to confirm the formula

Adapt the ranges to suit

Assumin that the list in A1:B5, if the functions in the
freelydownloadable file at http://home.pacbell.net/beban are available
to your workbook

=INDEX(VLookups("A",a1:b5,2),2)

Alan Beban
 
Another one:
=LOOKUP(2,1/(A1:A5="a"),B1:B5)


If I have a list:
A 10
B 3
C 5
A 8
D 6

How can I get VLookup to return to value associated with the last occurance
of A instead of the first (i.e the value 8)?
 

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

Back
Top