excell formulas

M

Mark

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
 
J

Joe User

Mark said:
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 ----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top