View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default time calculation

Remember that the format, if you wish to use AM/PM, does include a space
before the AM or PM.
It is 2:00 PM, not 2:00PM.
It is no good just formatting the *display* of the cell if you haven't
entered it correctly, as an incorrectly entered string will be treated as a
text string, and cell date formatting has no effect on text strings.

If you've got a vast amount of data incorrectly entered, you can use Edit/
Replace to change
AM
without a space to
AM
with a space at the beginning of the string, & similarly for PM.
--
David Biddulph

Siteman wrote:
i have read and tried all of the threads on calculating time
difference but none of them work.

Specifically
i have done an export of data to excell the times come out like this,
A B C
start end
2:00pm 3:50pm 1 ( i want to round this to the nearest hour)

I formated the above cells h:mm pm
and the formula cell as general with decimals

i have tried =b1-a1
=int((b1-a1)*24)

none of which work, if i delete the pm or am it will calculate, but
not accurately.

I want to round up the time calculation to the nearest number,
ie, 2:00pm 3:50pm 2(hours)

any thoughts?