Why bother with MOD function.
Since we don't know what kind of times will be used we can cover all hours
by using MOD or the other variation:
=IF(COUNT(A1:B1)<2,"",B1-A1+(B1A1))
--
Biff
Microsoft Excel MVP
"Teethless mama" wrote in message
...
Why bother with MOD function. Keeep it simple
It should be suffice
=IF(COUNT(A1:B1)<2,"",B1-A1)
"T. Valko" wrote:
Try this:
A1 = 7:00 AM
B1 = 5:00 PM
D1 = formula:
=IF(COUNT(A1:B1)<2,"",MOD(B1-A1,1))
Format the formula cell as h:mm. Result = 10:00
If you want the result as a decimal then use this formula:
=IF(COUNT(A1:B1)<2,"",MOD(B1-A1,1)*24)
Format the formula cell as GENERAL or NUMBER. Result = 10
--
Biff
Microsoft Excel MVP
"Ronnie Kray" <Ronnie wrote in message
...
if i start work at 7am and leave work at 5pm
how do i calculate the time worked using a formular?