Calculate minutes between range

Bijaz

New Member
Joined
Jan 23, 2011
Messages
38
I'm interested in calculating in room time (this is for an operating room) between 5 pm and 7 pm. We're trying to figure out how often we use 12 ORs between these two time. Currently I have a column with "in room time" and "out of room time" . I want to know how many minutes a patient was in the room during that 5-7 pm window. Is there a way to do this?

Here is what I would like it to look like[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Surgery date[/TD]
[TD]In Room Time[/TD]
[TD]OUt of Room Time[/TD]
[TD]Minutes between 5-7 pm[/TD]
[/TR]
[TR]
[TD]7/1/2013[/TD]
[TD]0700[/TD]
[TD]1659[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]7/1/2013[/TD]
[TD]1500[/TD]
[TD]1830[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]7/1/2013[/TD]
[TD]1820[/TD]
[TD]2100[/TD]
[TD]40[/TD]
[/TR]
[TR]
[TD]7/1/2013[/TD]
[TD]1859[/TD]
[TD]2130[/TD]
[TD]1[/TD]
[/TR]
</TBODY>[/TABLE]
 
My formula works for those instances on my machine.

Sheet1


*ABCD
DateInOut5-7 minutes

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:75px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]30/08/2013[/TD]
[TD="align: right"]07:00[/TD]
[TD="align: right"]16:59[/TD]
[TD="align: right"]00[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]31/08/2013[/TD]
[TD="align: right"]15:00[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]90[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]01/09/2013[/TD]
[TD="align: right"]13:51[/TD]
[TD="align: right"]21:19[/TD]
[TD="align: right"]120[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="align: right"]02/09/2013[/TD]
[TD="align: right"]18:40[/TD]
[TD="align: right"]20:13[/TD]
[TD="align: right"]20[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
D2=IF(C2>TIMEVALUE("17:00"),(IF(C2<=TIMEVALUE("19:00"),C2,TIMEVALUE("19:00"))-IF(B2>=TIMEVALUE("17:00"),B2,TIMEVALUE("17:00"))),0)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
p.s. please try to be clear to which solution you are refering to in your replies.[/QUOTE]

GOt it. I will try yours today.
 
Upvote 0
Does this work for you?

Sheet1

ABCD
Surgery dateIn Room TimeOUt of Room TimeMinutes between 5-7 pm

<COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 82px"><COL style="WIDTH: 64px"><COL style="WIDTH: 71px"><COL style="WIDTH: 70px"></COLGROUP><TBODY>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]07/01/2013[/TD]
[TD="align: right"]07:00[/TD]
[TD="align: right"]16:59[/TD]
[TD="align: right"]0[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]07/01/2013[/TD]
[TD="align: right"]15:00[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]90[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]07/01/2013[/TD]
[TD="align: right"]18:20[/TD]
[TD="align: right"]21:00[/TD]
[TD="align: right"]40[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="align: right"]07/01/2013[/TD]
[TD="align: right"]18:59[/TD]
[TD="align: right"]21:30[/TD]
[TD="align: right"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]
[TD="align: right"]07/01/2013[/TD]
[TD="align: right"]13:51[/TD]
[TD="align: right"]21:19[/TD]
[TD="align: right"]120[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="align: right"]07/01/2013[/TD]
[TD="align: right"]18:40[/TD]
[TD="align: right"]20:13[/TD]
[TD="align: right"]20[/TD]

</TBODY>

Spreadsheet Formulas
CellFormula
D2=MAX(MIN(MOD(C2,1),"19:00:00")-MAX(MOD(B2,1),"17:00:00"),0)

<TBODY>
</TBODY>

<TBODY>
</TBODY>


Excel tables to the web >> Excel Jeanie HTML 4

p.s. please try to be clear to which solution you are refering to in your replies.

Worked like a charm! Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,320
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top