12:00 AM

J

JP

I have the time in for one column and the time out in the adjacent
column. I then use this formula to subtract one time from the other:

=IF(C43=0,0,C43-B43+(C43<B43))

It works fine, but I just noticed that if the time out is exactly
12:00 am it gives a zero value. So,

10:00 pm 12:00 am reads 0 in stead of 2:00.

Can't figure out this one.
 
P

Pete_UK

Have you formatted the cell as a time? Perhaps it is set to General.

Hope this helps.

Pete
 
J

joeu2004

I have the time in for one column and the time out in the adjacent
column.  I then use this formula to subtract one time from the other:

=IF(C43=0,0,C43-B43+(C43<B43))

It  works fine, but I just noticed that if the time out is exactly
12:00 am it gives a zero value.  So,
10:00 pm  12:00 am reads 0 in stead of 2:00.

Because that is what your IF() function told it to do. Note that
12:00 AM is stored as a zero. If you did not test for C43=0, C43-B43+
(C43<B43) would have given you exactly what you want (properly
formatted).

Why are you testing C43=0 in the first place? That is, what condition
are you trying to exclude?

I suspect you should test for C43="".
Can't figure out this one.

When I cannot figure such things out, I change the format of the
cell. In this case, choosing the Number format might have been
sufficient. Often, I choose the Scientific format.
 

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