From: Mark on
Can someone tell why this formula returns a negitive
=IF((((F6-G6)+(I6-J6))*24)>8,8,((F6-G6)+(I6-J6))*24)

The cells f6 g6 i6 j6 are formated for time calculations in a time sheet
The time format is 01:00-24:00 hours

It returns the correct total except for the fact that the total comes up
negative.

Thanks
Mark
From: Joe User on
"Mark" wrote:
> Can someone tell why this formula returns a negitive
> =IF((((F6-G6)+(I6-J6))*24)>8,8,((F6-G6)+(I6-J6))*24)

It will return a negative value whenever F6-G6+I6-J6 < 0.

Without your provided details about the contents of all of the cells,
anything else I might say would be just speculation. Perhaps the times in G6
and/or J6 is greater than the times in F6 and/or I6, either because you are
subtracting the wrong way (earlier minus later) or because the times cross
midnight (two different days).

In any case, you can simplify your formula above to:

=MIN(8, (F6-G6+I6-J6)*24)


----- original message ----

"Mark" wrote:
> Can someone tell why this formula returns a negitive
> =IF((((F6-G6)+(I6-J6))*24)>8,8,((F6-G6)+(I6-J6))*24)
>
> The cells f6 g6 i6 j6 are formated for time calculations in a time sheet
> The time format is 01:00-24:00 hours
>
> It returns the correct total except for the fact that the total comes up
> negative.
>
> Thanks
> Mark