Lookup Value where it last appears in Column

rhombus4

Well-known Member
Joined
May 26, 2010
Messages
586
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

Trying to find corresponding value in Column E for a lookup in Column A
Normally I'd use =XLOOKUP(123, A2:A20,E2:E20) which will search column A and give me the value in Column E

What if there are multiple values for the searched item in Column A. It always gives the first it finds. is it possible to get the 2nd 3rd 4th etc or in ths case the last time it appears

Expected Results are
123 Cat even though its same value for both it should be cat as its the last value
345 dog. Even if it only appears once its still classed as last value
567 giraffe as its last one to appear
678 koala as it appears last


ABCDE
123​
rndtextrndtextrndtextcat
123​
rndtextrndtextrndtextcat
345​
rndtextrndtextrndtextdog
567​
rndtextrndtextrndtextelephant
567​
rndtextrndtextrndtextfrog
567​
rndtextrndtextrndtextgiraffe
678​
rndtextrndtextrndtexthedgehog
678​
rndtextrndtextrndtexthedgehog
678​
rndtextrndtextrndtextKoala
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
How about
Excel Formula:
=XLOOKUP(123, A2:A20,E2:E20,,,-1)
 
Upvote 0
Thanks. Not looked at the other arguments. What does the match_mode do and is it possible to look for 2nd occasion of a value or is it either 1st or last
 
Upvote 0
It's either 1st or last.
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,373
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top