Forum Discussion
Joaquin_w
Mar 23, 2024Copper Contributor
Problem with If function whith values in hours
Hi guys, Currently, for personal reasons I have to leave work quite frequently and I decided to create an Excel sheet to keep track of the hours that I am absent from work and must recover. To give...
HansVogelaar
Mar 23, 2024MVP
Time values are not text strings. You can use the TIMEVALUE function to convert a text string such as "10:00:00" to a real time.
=IF(AND(F2<=TIMEVALUE("10:00:00"); G2>=TIMEVALUE("10:30:00"); H2<=TIMEVALUE("3:13:00")); TIMEVALUE("0:30:00"); TIMEVALUE("0:00:00"))
Alternatively, use the TIME function:
=IF(AND(F2<=TIME(10;0;0); G2>=TIME10;30;0); H2<=TIME(3;13;0)); TIME(0;30;0); TIME(0;0;0))