Formula for identify related cells based on a common criteria

ishpahuja

New Member
Joined
May 6, 2015
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Hello everyone
I am looking to identify family members who are eligible for a benefit. Let's say govt. has identified a set of eligible fruits that qualify under benefits. If any family member sells one of those fruits, all family members become eligible for benefits. All family members are coded with a family ID. I am looking to find a formula to identify if someone is eligible or not.
For e.g.
For family ID 1111 - the first member sells Apple while second doesn't do anything - since apple is part of eligible fruits, both family members are eligible and coded under "Apple" category.
For family ID - 3333, first member sells papaya (not eligible fruit), but second member sells orange (eligible fruit), so orange should appear against these two family IDs.
For Family ID 2222 - only one member under eligible list, so "mango" appears.
For Family ID 4444 and 9999 - they and their family members don't sell eligible fruits, so nothing should appear against their names.

See in image the details and output column.

I tried for formula, but it appears it is more complicated than I think.
Can you help?
 

Attachments

  • Capture.PNG
    Capture.PNG
    13.7 KB · Views: 35

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Array confirm in J2 with Ctrl Shift Enter, then fill down.

=IFERROR(INDEX($L$2:$L$5,MATCH(TRUE,COUNTIFS($H$2:$H$10,H2,$I$2:$I$10,$L$2:$L$5)>0,0)),"")

Note that if you do not confirm the array correctly then all results will be blank.
 
Upvote 0
Array confirm in J2 with Ctrl Shift Enter, then fill down.

=IFERROR(INDEX($L$2:$L$5,MATCH(TRUE,COUNTIFS($H$2:$H$10,H2,$I$2:$I$10,$L$2:$L$5)>0,0)),"")

Note that if you do not confirm the array correctly then all results will be blank.
It didn't work :(

See image
 

Attachments

  • Capture2.PNG
    Capture2.PNG
    15.6 KB · Views: 28
Upvote 0
Can you please let me know wh
Looks like you didn't follow the instructions correctly.
You have filled down before confirming the array.
Thanks a lot. I corrected it. You are a genius! Thanks again.
 
Upvote 0
Would you mind sharing your logic? All this time, I was thinking it is quite difficult, and you made it sound like so simple. :)
 
Upvote 0
The logic is in countifs, this looks to see how many family members there are for each fruit type in the list. The rest of the formula looks to see which is the first one with a count more than zero.

COUNTIFS($H$2:$H$10,H2,$I$2:$I$10,$L$2:$L$5)
 
Upvote 0
The logic is in countifs, this looks to see how many family members there are for each fruit type in the list. The rest of the formula looks to see which is the first one with a count more than zero.

COUNTIFS($H$2:$H$10,H2,$I$2:$I$10,$L$2:$L$5)
Thank you so much. It helped a lot. Thanks once again.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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