View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default Military time not properly calulated

=(C42-E42+(E42C42))*24
Format as general

"0be1" wrote:

I have two cells that are set for h:mm and the time will switch throughout a
24 hour time period. For some reason ever fix I have tried, the time is still
not calculated properly.

For example:

The first cell is 10:18PM [h:mm] and the second 2:38AM [h:mm] and the
resultant cell has the formula (currently) as:

=C42-E42+(C42<=E42)*2400
I have also tried

=MAX(E42,C42)-MIN(C42:E42)

Both formulas return a value of 19:40. The difference between 10:18PM to
2:38AM the following day shows up as 19:40. Shouldn't the result be like 4
hours and 20 minutes. Or at least that is what I am trying to attempt the
output to be.

Does anyone have the answer?

tia...

Shawn