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
Name

<tbody>
</tbody>
Duty

<tbody>
</tbody>
Tom
duty1

<tbody>
</tbody>
Tomduty2
Tomduty3
Tomduty4
Meganduty5
Meganduty6
Meganduty7
Vinceduty8
Vinceduty9

<tbody>
</tbody>

2) Duty and Conflict

DutyConflict
duty1duty3
duty3duty1
duty5duty6
duty6duty5

<tbody>
</tbody>

Output required:
1) Name, Duty, Conflict
NameDutyConflict
Tom
duty1

<tbody>
</tbody>
duty3
Tom
duty3

<tbody>
</tbody>
duty1

<tbody>
</tbody>
Megan
duty5

<tbody>
</tbody>
duty6

<tbody>
</tbody>
Megan
duty6

<tbody>
</tbody>
duty5

<tbody>
</tbody>


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

Please advice.
Warm regards.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
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,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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