Time Problem

  • Thread starter Thread starter Sparky Peterson
  • Start date Start date
S

Sparky Peterson

I have the time I clock in and the time I clock out in two adjoining
cells. In the third cell I have, =b1-a1, to see how many minutes/and
or hours said person worked. It works great until I came upon this
entry:

11:55 PM 12:05 AM

The answer should be 0:10, but instead it reads:

#####################

Everything works fine except for this one situation. Any suggestions?

Thanks,

Sparky
 
Since XL stores times as fractional days, 11:55 PM is stored as
0.996527778 and 12:05 AM is 0.003472222. You have to add 1 to the later
time if the period branches across midnight. One way is to use the fact
that a boolean value is interpreted as 1 in a math formula:

=B1 - A1 + (B1<A1)

a somewhat more obscure way is

=MOD(B1-A1,1)
 
Hi Sparky,
you are creating a negative time value.
Try using this formula =IF(B1<A1,24-(A1-B1),B1-A1)
Note: This assumes that the maximum amount of time is 24
hours

HTH
 

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

Similar Threads

Converting dd:hh:mm to [h]:mm not working. 3
Display time format 1
Difference between dates and times 5
Daily Time Sheets with Rounding 1
Real-time clock in excel 8
question 1
Time function 5
Calculate time 10

Back
Top