Change the Formula in E2 to = "=A2" and copy down.
Change the Shift Function to
Function Shift(D As Range, DayShift As Boolean) As Long
Dim T As String
T = Format(D, "hh:mm")
If DayShift Then
If "06:00" <= T And T < "22:59" Then
Shift = 1
Else
Shift = 0
End If
Else
If ("23:00" <= T And T < "23:59") Or ("00:00" <= T) And (T < "06:00") Then
Shift = 1
Else
Shift = 0
End If
End If
End Function
You can Format Cells in Column E to only display times.
This won't work for any old Data sheets
You can use a Formula to call this function in Column E of old Data sheets to retrieve the date from Column A
Function GetDate(Dispatched As Range) As Date
GetDate = Split(Dispatched, " ")(0) & " " & Split(Dispatched, " ")(1)
End Function
E2 = GetDate(A2)