# Excel - Caculating Time between 2 times, within Hours of Operation

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

#### Dreambringer

Ok yet another challenge.

Here is what I have.

2 sets of date and time.

Code:
``````      Start Time                        End Time
1/6/2006 13:21:56            1/7/2006 8:54:21``````
Now if its the same day I do not have a problem. But this is where it get complicated.

We close at 8:00 PM (Central Time) and Open up at 7:00 AM (Central Time). So we are closed for 11 Hours.

So for this example the "Open Time" would be 8:32:25 because of our hours of operation.

So I have played around some forumulas and did not really come up with much which is why I am here.

So I know
Code:
``=SUM((L73-K73)-(TIME(11,0,0)))``
Would give me the correct "Open Time" but only for those on differnt days. Any ideas on how I can get it to check if its the same date first? I played around with a few IF statments but did not come up with much..

#### bomb #21

Maybe use INT to strip out the fractions? Like:

=(IF(INT(StartTime)=INT(EndTime),

etc.

HTH,
Andy

#### balloon_tom

Try : =(L73-K73)-(0.4583*(INT(L73)-INT(K73)))
very much along the same lines as Andy. 0.4583 is 11:00 o'clock.
Tom

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On