INDEX MATCH problem

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
677
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I have the following formula:

=IFERROR(INDEX('All Completed Runs'!$C$4:$C$2003,MATCH("*"&"United Kingdom"&"*"&"*"&A4&"*"&"<>1",'All Completed Runs'!$D$4:$D$2003&'All Completed Runs'!$C$4:$C$2003&'All Completed Runs'!$FL$4:$FL$2003,0),0),"")

The first two parts work fine, but the third search won't work. This third criteria should look in column ref 'All Completed Runs'!$FL$4:$FL$2003 and if there is a 1 in there not show a value. If there is not a 1 then the value should show. (if there is a 1 in 'All Completed Runs'!$FL$4:$FL$2003 then it is a restricted even and shouldn't be included).

Column ref 'All Completed Runs'!$FL$4:$FL$2003 displays as either blank ("") or a 1, according to the formula in that column.

Is there something about the <>1 that is not right? is it nor possible to do a 'not equal to' search within INDEX(MATCH?

Thanks in advance,

Olly.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi,

I have the following formula:

=IFERROR(INDEX('All Completed Runs'!$C$4:$C$2003,MATCH("*"&"United Kingdom"&"*"&"*"&A4&"*"&"<>1",'All Completed Runs'!$D$4:$D$2003&'All Completed Runs'!$C$4:$C$2003&'All Completed Runs'!$FL$4:$FL$2003,0),0),"")

The first two parts work fine, but the third search won't work. This third criteria should look in column ref 'All Completed Runs'!$FL$4:$FL$2003 and if there is a 1 in there not show a value. If there is not a 1 then the value should show. (if there is a 1 in 'All Completed Runs'!$FL$4:$FL$2003 then it is a restricted even and shouldn't be included).

Column ref 'All Completed Runs'!$FL$4:$FL$2003 displays as either blank ("") or a 1, according to the formula in that column.

Is there something about the <>1 that is not right? is it nor possible to do a 'not equal to' search within INDEX(MATCH?

Thanks in advance,

Olly.
Without looking at your original data set; I have a question: in your MATCH function's lookup value you have a double wildcard ("*"&"*") - why?
One wildcard entry should be enough to pickup whatever comes after "United Kingdom" but before the value in A4 as it is my understanding that wildcards ("*") can pick up single character strings or multi-character strings.
In anycase I've rewritten your above formula below, try and see if it works, and let me know.
=IFERROR((INDEX(('All Completed Runs'!$C$4:$C$2003), (MATCH((("*"&"United Kingdom"&"*"&A4&"*")<>(1) ), (('All Completed Runs'!$D$4:$D$2003)&('All Completed Runs'!$C$4:$C$2003)&('All Completed Runs'!$FL$4:$FL$2003) ), (0) ) ), (0) ) ), ("") )
 
Upvote 0
Hi.

Thanks for looking this. Not sure why I used the wildcards in that way at the time, I did these ones quite a while a ago.

I didn't attach original dataset as it is a massive workbook with lots of interlinked worksheets. I can provide a link if you like, but it can take a long time to open.

Just popping out a moment, so will try this as soon as I get back.

Thanks again.
 
Upvote 0
Without looking at your original data set; I have a question: in your MATCH function's lookup value you have a double wildcard ("*"&"*") - why?
One wildcard entry should be enough to pickup whatever comes after "United Kingdom" but before the value in A4 as it is my understanding that wildcards ("*") can pick up single character strings or multi-character strings.
In anycase I've rewritten your above formula below, try and see if it works, and let me know.
=IFERROR((INDEX(('All Completed Runs'!$C$4:$C$2003), (MATCH((("*"&"United Kingdom"&"*"&A4&"*")<>(1) ), (('All Completed Runs'!$D$4:$D$2003)&('All Completed Runs'!$C$4:$C$2003)&('All Completed Runs'!$FL$4:$FL$2003) ), (0) ) ), (0) ) ), ("") )
Hi, it didn't work, unfortunately. I can give a link to the file, but it is quite large and can take a few minutes to open. It's 57mb in size. I have included a screenshot.

Screenshot 2022-01-18 at 18.19.50.png


OneDrive: parkrun - My parkrun Record (Oliver Hughes - A132324).xlsx
Dropbox: parkrun - My parkrun Record (Oliver Hughes - A132324).xlsx

Thanks.
 
Upvote 0
Maybe
Excel Formula:
=FILTER('All Completed Runs'!$C$4:$C$2003,('All Completed Runs'!$D$4:$D$2003="United Kingdom")*(ISNUMBER(SEARCH(A4,'All Completed Runs'!$C$4:$C$2003)))*('All Completed Runs'!$FL$4:$FL$2003<>1),"")
 
Upvote 0
I think I have now solved this with an XLOOKUP instead:

=IFERROR(IF(XLOOKUP("*Bushy*",'All Completed Runs'!$C$4:$C$2003,'All Completed Runs'!$FL$4:$FL$2003,"",2)<>1,XLOOKUP("*Bushy*",'All Completed Runs'!$C$4:$C$2003,'All Completed Runs'!$C$4:$C$2003,"",2),""),"")

Thanks.
 

Attachments

  • 1642533693117.png
    1642533693117.png
    297 bytes · Views: 5
Upvote 0
Maybe
Excel Formula:
=FILTER('All Completed Runs'!$C$4:$C$2003,('All Completed Runs'!$D$4:$D$2003="United Kingdom")*(ISNUMBER(SEARCH(A4,'All Completed Runs'!$C$4:$C$2003)))*('All Completed Runs'!$FL$4:$FL$2003<>1),"")
Thanks. I'll try this as well.
 
Upvote 0
If you can multiple results this will return the first
Excel Formula:
=index(FILTER('All Completed Runs'!$C$4:$C$2003,('All Completed Runs'!$D$4:$D$2003="United Kingdom")*(ISNUMBER(SEARCH(A4,'All Completed Runs'!$C$4:$C$2003)))*('All Completed Runs'!$FL$4:$FL$2003<>1),""),1)
 
Upvote 0
Solution
If you can multiple results this will return the first
Excel Formula:
=index(FILTER('All Completed Runs'!$C$4:$C$2003,('All Completed Runs'!$D$4:$D$2003="United Kingdom")*(ISNUMBER(SEARCH(A4,'All Completed Runs'!$C$4:$C$2003)))*('All Completed Runs'!$FL$4:$FL$2003<>1),""),1)
Brilliant, that is what I was after. Thanks so much. I feel like I owe you a crate of beers for your help over the past 18 months or so! So helpful and patient with my lack of knowledge!
 
Upvote 0

Forum statistics

Threads
1,214,870
Messages
6,122,019
Members
449,060
Latest member
LinusJE

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