Using Excel to match columns according to business requirement

kravi88

New Member
Joined
Jun 25, 2014
Messages
5
Hello Everybody,

I have a business requirement to come up with a list of conflicting duties for any person who has duties assigned.
I am not able to get the logic to do this on Excel and would need some help.

Tables I have (Inputs):
1) Name and Duty
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]Name[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="class: xl65, width: 64"]Duty[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Tom[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]duty1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Tom[/TD]
[TD]duty2[/TD]
[/TR]
[TR]
[TD]Tom[/TD]
[TD]duty3[/TD]
[/TR]
[TR]
[TD]Tom[/TD]
[TD]duty4[/TD]
[/TR]
[TR]
[TD]Megan[/TD]
[TD]duty5[/TD]
[/TR]
[TR]
[TD]Megan[/TD]
[TD]duty6[/TD]
[/TR]
[TR]
[TD]Megan[/TD]
[TD]duty7[/TD]
[/TR]
[TR]
[TD]Vince[/TD]
[TD]duty8[/TD]
[/TR]
[TR]
[TD]Vince[/TD]
[TD]duty9[/TD]
[/TR]
</tbody>[/TABLE]

2) Duty and Conflict

[TABLE="width: 500"]
<tbody>[TR]
[TD]Duty[/TD]
[TD]Conflict[/TD]
[/TR]
[TR]
[TD]duty1[/TD]
[TD]duty3[/TD]
[/TR]
[TR]
[TD]duty3[/TD]
[TD]duty1[/TD]
[/TR]
[TR]
[TD]duty5[/TD]
[TD]duty6[/TD]
[/TR]
[TR]
[TD]duty6[/TD]
[TD]duty5[/TD]
[/TR]
</tbody>[/TABLE]

Output required:
1) Name, Duty, Conflict
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Duty[/TD]
[TD]Conflict[/TD]
[/TR]
[TR]
[TD]Tom[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]duty1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]duty3[/TD]
[/TR]
[TR]
[TD]Tom[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]duty3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD]duty1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Megan[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]duty5[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]duty6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Megan[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]duty6[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]duty5[/TD]
[/TR]
</tbody>[/TABLE]


I have attached a sample of the requirement. It has the input tables and the required output.

Please advice.
Warm regards.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi, just curious, why don't you just index the name of your #1 to match the Duty in your #2?
 
Upvote 0
Hi, just curious, why don't you just index the name of your #1 to match the Duty in your #2?

Hey !

Well, I want conflicts to be listed only if both the duty and the conflicting duty is assigned to the person.
And I need this to be done individually for each person. That's the reason I did not use indexing.

Any ideas ?
 
Upvote 0
With a different presentation and a specific reference number rather than just the name (although you can change that to show only the name if you prefer).
Given in A1:

Excel 2010
ABCDEF
1NameDutyref_#cdtref_#
2Tomduty11Megan5
3Tomduty22duty16
4Tomduty33duty3
5Tomduty44duty5
6Meganduty55duty6
7Meganduty66
8Meganduty77
9Vinceduty88
10Vinceduty99
kravi88



Formula in F2 is =IFERROR(SMALL(IF(MMULT(COUNTIF($E$2:$E$6,$A$2:$B$10),{1;1})=2,$C$2:$C$10),ROWS($F$1:F1)),"") copied down till needed.
Note range G2 to G6 could be a table then the reference COUNTIF($E$2:$E$6 could be changed to make reference to said table such as COUNTIF(Table1[cdt], , this would make it dynamic, hence you could add or remove conflict and names on the go...
 
Last edited:
Upvote 0
Hi cyrilbrd,

I'm not sure where you have to keep the "Duties,Conflict" table when I use your solution. I'm kind of very new to this.
And I noticed that in your result, you have Megan but not Tom.

Regards and Happy Friday.
 
Upvote 0
You need not keep the conflict table, as the data are redundant, you need only a list as shown in post#4 cell E1 to E6.
This range being a table you may add names and conditions as you see it fit. Please look at the same below:

Excel 2010
ABCDEFG
1NameDutyref_#cdtref_#name
2Tomduty11tom1Tom
3Tomduty22duty13Tom
4Tomduty33duty35Megan
5Tomduty44duty56Megan
6Meganduty55duty6
7Meganduty66megan
8Meganduty77vince
9Vinceduty88
10Vinceduty99
kravi88



As you can see I added megan and vince to the table and the query returned the names and reference of the conflicted schedule.
To create a table, highlight the range and go to Insert / Table , a pop up windows may appear asking you to confirm range and indicate if the table has headers (yes).
Once this done the formula will dynamically computed based on whatever conditions are stated in said table.

Let me know if you require further assistance.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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