Finding the second instance with an xlookup

ECB

Board Regular
Joined
Mar 3, 2009
Messages
62
Office Version
  1. 365
Platform
  1. MacOS
  2. Mobile
Hi there,

Hope you are all well, it's been a while.

As always I've had a scratch about but I can't seem to find an answer to this.

I've got a formula

=XLOOKUP($A2&"ebrf",External_survey_block_attribute!$C$1:$C$12135&External_survey_block_attribute!$G$1:$G$12135,External_survey_block_attribute!$K$1:$K$12135,"",0,1)

I've got a data dump of 70,000 lines and I'm trying to extract the relevant data that I need from it.

I discovered the two criteria xlookup which is just brilliant. Most of the data only has 1 relevant line to return to the lookup, all so far so good.

However, due to historic issues with the data, sometimes there's a second line which matches the lookup so I wondered if there was a way to change the formula to skip the first lookup, and return the data from the second instance?

Does that make sense?

Appreciate any pointers that anyone can give.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try changing the search mode to -1.
 
Upvote 1
Great thanks, I'll try that.

What if there was a third instance and I wanted to find that?

Sorry, just to elaborate:

The problem with -1 is that it returns the only line if there is only a single line. I'm looking for something that will return both lines?
 
Upvote 0
Search mode -1 looks for the last instance, so if the third instance is also the last then that should work.

Edit: Try FILTER.
Excel Formula:
=FILTER(External_survey_block_attribute!$K$1:$K$12135,External_survey_block_attribute!$C$1:$C$12135&External_survey_block_attribute!$G$1:$G$12135=$A2&"ebrf)
 
Upvote 0

Forum statistics

Threads
1,216,750
Messages
6,132,502
Members
449,730
Latest member
SeanHT

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