Comparing two lists with criteria in multiple rows

dgock

New Member
Joined
Jun 10, 2016
Messages
2
Hello,

I have worksheet with two columns. One has names of students and the other one has school course codes the students are requesting. I would like to know how many students are requesting two courses which would be a conflict should those courses occur at the same time. Put another way, how many students have requested both 'MCH--11' and 'MEN--11'. I've attached a sample of the table below. Thank you in advance for all of your advice and experience.

NameCrsNo
NathanMCH--11
NathanMEN--11
NathanMIMG-12
NathanMPE--11
NathanMPREC11
NathanMSP--11
NathanMSS--11
NathanMTPA-11
JohnMEN--10
JohnMFMP-10
JohnMINT-10
JohnMPE--10
JohnMPLAN10CO1
JohnMSC--10
JohnMSS--10
JohnXLDCD10
MaryMBEG-10
MaryMEN--10
MaryMFMP-10
MaryMJA--10
MaryMPE--10
MaryMPLAN10CO1
MaryMSC--10
MaryMSS--10
JillMAWM-11
JillMDFT-11
JillMEN--11ENR
JillMESC-11
JillMFR--11
JillMIMCB11CO1
JillMPE--11
JillMSS--11
MikeMEN--10
MikeMFMP-10
MikeMPE--10
MikeMPLAN10CO2
MikeMSC--10
MikeMSP--10
MikeMSS--10
MikeMVAG-10
SamMADEM08
SamMADFS08
SamMADW-08
SamMEN--08
SamMFR--08
SamMMA--08
SamMMU--08BA3
SamMPHE-08
SamMSC--08
SamMSS--08
CarolMAC--11
CarolMCH--11
CarolMEN--11
CarolMFM--11
CarolMFR--11
CarolMPREC11
CarolMSS--11
CarolXAT--11WEX
CarolYHRA-1A
RickMBI--11
RickMEN--11
RickMFM--11
RickMPE--11
RickMPREC11
RickMSP--11
RickMSS--11
RickXAT--11
MaggieMCH--11
MaggieMEN--11
MaggieMICTP11
MaggieMPH--11
MaggieMPREC11
MaggieMSP--11
MaggieMTPA-11
MaggieXAT--11
MaggieXDPA-11
GlenAPSY-12
GlenMBI--12
GlenMCMCC12
GlenMDNP-12
GlenMEN--12
GlenMGT----
GlenMIDS-2C
GlenMSACS12
GlenXAT--12
GlenYVPA-2C

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Do you have the criteria's / list of courses that conflicts. If so please share.

Per my understanding you can make use of "Countifs"

To make it in the nature of control sheet, prepare a table with name of the courses on the X Axis and Name of the Students on Y Axis.

You can use =COUNTIFS($B:$B,J$1,$A:$A,$I2) (Where Column A is list of all candidates and B is list of the courses requested - the format from your query above)

Row 1 starting from Column J has list of all unique courses and Column I has list of unique students names. Based on the formula above you will get values of the courses requested by the students.

Now, You can use this table as a source table for your List of Courses that conflict. For example,

In Column J you will get 1 for students requesting MCH-11 and in Column K students requesting MEN-11, you can define criteria between those courses and identify the duplicates. You can also use conditional formatting for highlighting these duplicate instances out.

In case my understanding is not correct. Please provide more details so that we can help you out.
 
Upvote 0
I apologize, but I think I need to provide more clarification of the situation and try to provide a more simplified spreadsheet for illustration:

- The Name and CrsNo fields are extracted from another sources so I would prefer to not have to reorder or format it
- The Test Course is entered by the user
- The Course Location is entered by the user
- The Course List is generated based upon course that are being offered in the Course Location
- The Potential Conflict column is what I need assistance on
- I would like to be able to scan the Name and CrsNo columns and count which students have both the Test Course code and the Course List code in their requests
- I have put the results of what the values should be:
- e.g.s
- For the Course List code MSC--11, the students John and Mary have this request and also have MCH-11 course request. Therefore if I were to place MCH--11 course in the 1(2) location it would conflict with 2 students
- For the Course List code MEN--11, the students Nathan, John, and Jill have this and MCH--11 as course requests. Therefore if I were to place a MCH--11 course in the 1(2) location it would be a conflict with all 4 students


NameCrsNoTest CourseCourse LocationCourse ListPotential Conflict
NathanMCH--11 MCH--111(2)MSC--102
NathanMEN--11 MEN--113
NathanMIMG-12 MIMG-121
NathanMPE--11 MPE--113
NathanMPREC11 MPREC111
NathanMSP--11 MSP--111
NathanMSS--11 MSS--113
NathanMTPA-11 MTPA-111
JohnMEN--11
JohnMCH--11
JohnMINT-10
JohnMPE--11
JohnMPLAN10CO1
JohnMSC--10
JohnMSS--10
JohnXLDCD10
MaryMBEG-10
MaryMEN--11
MaryMBI--11
MaryMJA--10
MaryMPE--11
MaryMPLAN10CO1
MaryMSC--10
MaryMSS--11
JillMAWM-11
JillMDFT-11
JillMEN--11
JillMESC-11
JillMFR--11
JillMCH--11
JillMPE--11
JillMSS--11

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

Thanks for all your time and consideration of this scenario!
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,799
Members
449,337
Latest member
BBV123

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