sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,404
- Office Version
- 2016
- Platform
- Windows
I'm having an issue trying to identify if a time falls between 2 times.
I need to know if the time falls between 23:59 and 05:00 - the cell I'm using is formatted as custom "dd/mm/yyyy hh:mm" and the actual cell value is "01/11/2022 00:35". Using this formula the result should be YES, but it's returning NO:
=IF(AND(C2>="23:59",C2<="05:00"),"YES","NO")
Ideally I need this to be achieved by VBA but for now I just need to understand why it isn't producing the correct result - can anyone help me understand?
I need to know if the time falls between 23:59 and 05:00 - the cell I'm using is formatted as custom "dd/mm/yyyy hh:mm" and the actual cell value is "01/11/2022 00:35". Using this formula the result should be YES, but it's returning NO:
=IF(AND(C2>="23:59",C2<="05:00"),"YES","NO")
Ideally I need this to be achieved by VBA but for now I just need to understand why it isn't producing the correct result - can anyone help me understand?