Lookup with Exclusion List formula

ghrain22

Active Member
Joined
Jan 9, 2014
Messages
473
I'm try to perform a look up and cross reference an exclusion list, and would appreciate any help. I want to return the smallest number that who's lookup value is NOT in the exclusion list.

List:
#typefruit
1nectarineorange
5navalorange
4tangerineorange
2clementineorange
3mcintoshapple
7fujiapple
6honey crispapple
9gold and deliciousapple
10honeydewmelon
8water melonmelon
4canteloupmelon

<tbody>
</tbody>

Exclusion List:
type
nectarine
mcintosh
water melon

<tbody>
</tbody>


Output:
fruitoutputshould return
apple{formula}
honey crisp

<tbody>
</tbody>
melon{formula}
canteloupe

<tbody>
</tbody>
orange{formula}
tangerine

<tbody>
</tbody>

<tbody>
</tbody>


This was my attempt through using arrays(although it doesn't work maybe it can be of some inspiration?):

=VLOOKUP(SMALL(IF(IF(M2=INDEX(list,,3,1),INDEX(list,,2,1),"")=exclusion,MAX(INDEX(list,,1,1))+1,INDEX(list,,1,1)),1),list,2,FALSE)

The above formula is using the named ranges for the tables listed above.

Any help would be greatly appreciated!

Thanks!
Ghrain22
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Your # list should be unique - you have 2 "4"s in it. It you can change the 2nd 4 to maybe 4.0001, then this formula works - ctrl+shift+enter & fill down (I used range names, but I think they're obvious what they refer to):
=INDEX(type,MATCH(MIN(IF(fruit=A19,IF(ISNA(MATCH(type,Exclusion,0)),num))),num,0))
 
Upvote 0
Define the following...
num as referring to A2:A12;
type as referring to B2:B12;
fruit as referring to C2:C12.

Let exclusion (as you already defined) refer to list of exclusions.

Let A:B of say Sheet2 house the required processing...


fruitoutput
applehoney crisp
melontangerine
orangeclementine

<COLGROUP><COL style="WIDTH: 62pt; mso-width-source: userset; mso-width-alt: 2958" width=83><COL style="WIDTH: 78pt; mso-width-source: userset; mso-width-alt: 3697" width=104><TBODY>
</TBODY>

B2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=INDEX(type,
  MIN(IF(num=MIN(IF(IF(ISNUMBER(MATCH(type,exclusion,0)),"",fruit)=A2,num)),
  ROW(type)-ROW(INDEX(type,1,1))+1)))

Note that the result for orange is clementine (num = 2), not tangerine (num = 4).
 
Upvote 0
Define the following...
num as referring to A2:A12;
type as referring to B2:B12;
fruit as referring to C2:C12.

Let exclusion (as you already defined) refer to list of exclusions.

Let A:B of say Sheet2 house the required processing...


fruit
output
apple
honey crisp
melon
tangerine
orange
clementine

<TBODY>
</TBODY>

B2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=INDEX(type,
  MIN(IF(num=MIN(IF(IF(ISNUMBER(MATCH(type,exclusion,0)),"",fruit)=A2,num)),
  ROW(type)-ROW(INDEX(type,1,1))+1)))

Note that the result for orange is clementine (num = 2), not tangerine (num = 4).

Correction...

fruitoutput
applehoney crisp
meloncanteloup
orangeclementine

<COLGROUP><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 106pt; mso-width-source: userset; mso-width-alt: 5006" width=141><TBODY>
</TBODY>

Rich (BB code):
=INDEX(type,MIN(IF(fruit=A2,
  IF(num=MIN(IF(IF(ISNUMBER(MATCH(type,exclusion,0)),"",fruit)=A2,num)),
  ROW(type)-ROW(INDEX(type,1,1))+1))))
 
Upvote 0
Note that the result for orange is clementine (num = 2), not tangerine (num = 4).

This is why we have Excel do such processes :). Thank you both for your help. Both you suggestions inspired me as to how to run through the array properly.

For future readers, Aladin's formula post worked well for this (with ctrl+shft+enter):

Code:
[FONT=lucida console]=INDEX(type,MIN(IF(fruit=A2, IF(num=MIN(IF(IF(ISNUMBER(MATCH(type,exclusion,0)),"",fruit)=A2,num)), ROW(type)-ROW(INDEX(type,1,1))+1))))[/FONT]
 
Upvote 0
This is why we have Excel do such processes :). Thank you both for your help. Both you suggestions inspired me as to how to run through the array properly.

For future readers, Aladin's formula post worked well for this (with ctrl+shft+enter):

Code:
[FONT=lucida console]=INDEX(type,MIN(IF(fruit=A2, IF(num=MIN(IF(IF(ISNUMBER(MATCH(type,exclusion,0)),"",fruit)=A2,num)), ROW(type)-ROW(INDEX(type,1,1))+1))))[/FONT]

That's great. Thanks for providing feedback.
 
Upvote 0

Forum statistics

Threads
1,214,958
Messages
6,122,475
Members
449,087
Latest member
RExcelSearch

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