A few things
Firstly, Change the Course Dates in the Course Table Table, to Integers
They are currently 01-02-2018 9:00AM
Change them to just the dates eg: 1/2/2018 etc
the display format doesn't matter
Now remove the Conditional Formats from the Calendar
Then on the Mandatory Calendar worksheet
AS5: =IFERROR(INDEX(INDEX(Datum,0,3),SMALL(IFERROR(IF(INDEX(Datum,0,2)=(1*$G$2),ROW($AS$1:$AS16),9999),9999),ROW(D1))),"")
Ctrl+Shift+Enter
AT5: =IFERROR(INDEX(INDEX(Datum,0,4),SMALL(IFERROR(IF(INDEX(Datum,0,2)=(1*$G$2),ROW($AS$1:$AS16),9999),9999),ROW(D1))),"")
Ctrl+Shift+Enter
AU5: =IFERROR(INDEX(INDEX(Datum,0,5),SMALL(IFERROR(IF(INDEX(Datum,0,2)=(1*$G$2),ROW($AS$1:$AS16),9999),9999),ROW(D1))),"")
Ctrl+Shift+Enter
AV5: =IFERROR(INDEX(INDEX(Datum,0,6),SMALL(IFERROR(IF(INDEX(Datum,0,2)=(1*$G$2),ROW($AS$1:$AS16),9999),9999),ROW(D1))),"")
Ctrl+Shift+Enter
I also changed the VBA slightly
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Application.Intersect(Target, Range("Calen")) Is Nothing Then
Worksheets("Mandatory Calendar").Range("G2") = Int(Target.Value)
Worksheets("Mandatory Calendar").Range("G2").NumberFormat = "d mmm yy"
End If
Application.Calculate
End Sub
or see the attached file:
To understand how those formula work please read:
https://chandoo.org/wp/formula-forensics-003/
If you want to add the Conditional Formatting back use a formula like :
=MATCH(B5,Table!$C$3:$C$24,0)