I am trying to compare only day from the below interval:
Sheets("DATA").Range("H:H").NumberFormat = "mm/dd/yyyy hh:mm am/pm"
I found myself a solution with this IF function that is included in many other IF's
If Sheets("Data").Range("i" & i).Value <> "N/A" And Sheets("Data").Range("K" & i).Value <> "N/A" Then
If Day(Sheets("Data").Range("i" & i)) = Day(Sheets("DATA").Range("K" & i)) Then
Sheets("Data").Range("S" & i).Value = "Equals"
ElseIf Day(Sheets("Data").Range("i" & i)) > Day(Sheets("DATA").Range("K" & i)) Then
Sheets("Data").Range("S" & i).Value = "Later"
Else: Sheets("Data").Range("S" & i).Value = "Earlier"
End If
Else: Sheets("Data").Range("S" & i).Value = "N/A"
End If
That seems to do the trick - compare only day from the all date interval and write in column S is it the same day, later, or earlier, or "not available".
However, this didnot not work if one or another date is in another month (as there are high volumes more than 500k rows of data from 2012-2013)
How can I compare year/month/date from this format "mm/dd/yyyy hh:mm am/pm" without - deleting hours and minutes from the original row (creating new row without hours/minutes is also not an option)
Thanks!