Error if more than 1 occurance

traggs25

New Member
Joined
Jun 28, 2014
Messages
9
Ok so I have a large grid. I have an index match formula that is searching for the teacher & period and returning the course. I want to include a "check" in the formula that shows an error if the same teacher is has their name more than once for the same period.


My formula currently in cell S4 is...

=iferror(if(R4="","",index(B:B,match(R4&$S$3,C:C&A:A,0))))

I would like it to return an error because R4 ("Math1") is listed twice next to S3 ("1").


Hope that makes sense.


<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
ABCD
GEN
7th RedCourseTeacher7th RedCourseTeacher7th RedCourseTeacher7th RedCourseTeacher
1Math 7 (Red)Math1111
2Math 7 (Red)Math1222
333Math 7 (Red)Math13
444Math 7 (Red)Math14
5555
6666
7777
88Math 7 Lab (Red)Math188Math 7 Lab (Red)Math3
GEN
7th BlueCourseTeacher7th BlueCourseTeacher7th BlueCourseTeacher7th BlueCourseTeacher
1Math 7 (Blue)Math11Math 7 (Blue)Math111
22Math 7 (Blue)Math122
3333Math 7 (Blue)Math1
4444Math 7 (Blue)Math1
5555
6666
7777
8Math 7 Lab (Blue)Math188Math 7 Lab (Blue)Math38
SPED
7th GoldCourseTeacher7th GoldCourseTeacher7th GoldCourseTeacher7th GoldCourseTeacher
111Math 7 (Gold)Math11
222Math 7 (Gold)Math12
3Math 7 (Gold)Math1333
4Math 7 (Gold)Math1444
5555
6666
7777
88Math 7 Lab (Gold)Math388Math 7 Lab (Gold)Math1

<colgroup><col style="width: 69px"><col width="100"><col width="100"><col width="19"><col width="69"><col width="100"><col width="100"><col width="19"><col width="69"><col width="100"><col width="100"><col width="19"><col width="69"><col width="100"><col width="100"></colgroup><tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Where's R4 and S3 ?

Is your grid too wide for this forum?

Post a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
You cant attach files on this forum. There are tools on this forum for adding small spreadsheet images

https://www.mrexcel.com/forum/about-board/508133-attachments.html

Or upload the file to an online storage site and post a link to it, though some people may not download the file for fear of viruses.
 
Upvote 0

Forum statistics

Threads
1,215,014
Messages
6,122,697
Members
449,092
Latest member
snoom82

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