Returning a value based on two conditions - where there is no winner

Djmason2001

New Member
Joined
Feb 24, 2020
Messages
14
Office Version
  1. 2013
Platform
  1. Windows
Hi Forum,

Sorry to post so much today. I posted a question earlier today and a user helped me find a solution to scenario 1 i outlined below.

However after further analysis on my data i see that i have missed a scenario which i didn't include in my initial thread, consequently the formula doesn't accommodate for the scenario/

Scenario 1) Based on two conditions “Group id(Column B)” and where “Helper (Column C) = "Master” I would like to return a value id(Column A) in Column D. - Resolved
Scenario 2) Based on two conditions “Group id(Column B)” and where “Helper (Column C) = "Joint Master” I would like to return either value id(Column A) in Column D.

Group 21 & 25 - Resolved has part of scenario 1

Formula in the outcome column is the following
=INDEX($A:$A,MATCH(B2&"master",$B$1:$B$100&$C$1:$C$100,0))

ID : Unique Id
Group Id : is a grouping mechanism to identify that two records should be considered for comparison
Helper : Is a indicator column to determine which id should be returned from Column A based on the GroupId.

IDGroup IDHelperOutcome
1234
21Master
1234
2222
21Non Master
1234
333325Non Master4444
4444
25
Master4444
555526Joint Master5555 or 6666 (No preference on which ID to be returned)
666626Joint Master 5555 or 6666 (No preference on which ID to be returned)


Looking forward to your response
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Maybe:

Book1
ABCD
1IDGroup IDHelperOutcome
2123421Master1234
3222221Non Master1234
4333325Non Master4444
5444425Master4444
6555526Joint Master5555
7666626Joint Master5555
Sheet1
Cell Formulas
RangeFormula
D2:D7D2=INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$100)/($B$2:$B$100=B2)/ISERROR(SEARCH("non",$C$2:$C$100)),1))
 
Upvote 0
HI Eric,
Thank you for providing a viable solution.
Is there a way where i can mark this answer as solved ?
 
Upvote 0
Nope, this forum's policy is that threads are not closed or marked "Solved". The reason being that someone might come along later with a different, possibly better version. On some threads there has been some fun synergy where several people throw out ideas and we end up with something that no one person would have come up with. Or possibly someone has a followup question. So just leave a comment saying that you have an acceptable solution so that people don't continue to work on it.

Glad I could help! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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