View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default calculating time

Try this instead of your formula:

=IF(B1-A1<0,((B1-A1+1)*24)-D1,((B1-A1)*24)-D1)

Hope this helps.

Pete

mats wrote:
i have a problem when wanting to calculate time using 24 hour clock, i have
attached a simple example:

These are the columns & row 1:
A B C D
E
Start Finish Time of break Break length Hours
8:00 18:00 13:00 1.00 9.00
23:00 7:00 2:00 1.00 ERROR

I want to be able to use it for night time hours, the example that is there,
I want to calculate from 11pm to 7am, with 1 hour break at 2am, how can I do
this?
The formula that i am using is as follows: Format of cells is 13:30
=IF(B1-A1<0,"ERROR",((B1-A1)*24)-D1)