Time Formula Explanation Please

C

CharlesF

I was given the formula below to calculate an employee's hours:
=(F4-C4+(F4<C4))*24 where C4 is Start Time and F4 is End Time.

I can understand the way the formula works in general, but can no
understand how the section (F4<C4) corrects the hours when and employe
starts work at 20:00 and finishes the next day at 06:00.

Can someone please enlighten me?

Thank
 
B

Bernard Liengme

Hi Charles
The 'code' (F4<C4) would normally return TRUE or FALSE but when Excel
encounters a Boolean expression within an arithmetic formula, it returns 1
or 0. So if C4 is less than F4 (i.e. the clock swept passed midnight during
a shift) the formula adds 1.

Best wishes
 

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