View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Time sheet template military hours problem

You can reduce that formula to:

=MIN(8,((D3-C3)+(F3-E3))*24)

In Excel time is stored as a fraction of a day. A day has a numeric value of
1 so time is a fractional part of 1.

12:00 PM is half a day so the numeric value for 12:00 PM is half of 1 or
0.5. The format used to display the time is irrelevant as to how the time is
calculated. The format is for *display purposes only*.

6:00 PM and 18:00 have the same numeric value, 0.750.

You can see the decimal value of the time by entering a time like 12:00 PM
then, with that cell still selected, goto the menu FormatCellsNumber
tabselect General.

So, if you're not getting the correct result something else is the cause.


--
Biff
Microsoft Excel MVP


"Cheryl" wrote in message
...
Hi everyone,

I'm using the MS Excel online template numbered TC062071411033. In the
cell
that calculates the hours worked from the time that the user inputs is a
formula as follows:

=IF((((D3-C3)+(F3-E3))*24)8,8,((D3-C3)+(F3-E3))*24)

This formula only works properly if the time entered is formatted in
military format. I want to use standard am/pm hours instead. Any idea of
how to change the formula so it will work correctly with am/pm?

Thanks!