ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to compare time in hh:mm format using IF function? (https://www.excelbanter.com/excel-worksheet-functions/169538-how-compare-time-hh-mm-format-using-if-function.html)

thanks

how to compare time in hh:mm format using IF function?
 
Sir,
This is a sample of worksheet.
D
6 4:00 AM
7 11:00 AM

And I have to subtract time using IF function and tried these syntexes
=IF(D6<"8:00",("8:00"-D6), IF(D6"8:00 AM", (D6 - "8:00"), "OK")) and
=IF(D6<"8:00", "LESS", IF(D6"8:00", "MORE", "OK")) and
=IF(D6<"8:00",("8:00"-D6), (MOD(D6-"8:00",1)))

But in all cases i found an error. I have to calculate the less time and
over time by an employee.

Please Suggest me. I have been tring it for 7-8days.





Stefi

how to compare time in hh:mm format using IF function?
 
Use
TIME(8,0,0)
instead of "8:00" string!

Regards,
Stefi

€˛Thanks€¯ ezt Ć*rta:

Sir,
This is a sample of worksheet.
D
6 4:00 AM
7 11:00 AM

And I have to subtract time using IF function and tried these syntexes
=IF(D6<"8:00",("8:00"-D6), IF(D6"8:00 AM", (D6 - "8:00"), "OK")) and
=IF(D6<"8:00", "LESS", IF(D6"8:00", "MORE", "OK")) and
=IF(D6<"8:00",("8:00"-D6), (MOD(D6-"8:00",1)))

But in all cases i found an error. I have to calculate the less time and
over time by an employee.

Please Suggest me. I have been tring it for 7-8days.






All times are GMT +1. The time now is 08:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com