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]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Maybe like this?

Excel Workbook
ABCD
1Surgery dateIn Room TimeOUt of Room TimeMinutes between 5-7 pm
207/01/201370016590
307/01/20131500183090
407/01/20131820210040
507/01/2013185921301
607/01/20131730184575
Sheet1
 
Upvote 0
Assuming that those values are stored as time then the following formula will work.
=IF(C2>TIMEVALUE("17:00"),(IF(C2<=TIMEVALUE("19:00"),C2,TIMEVALUE("19:00"))-IF(B2>=TIMEVALUE("17:00"),B2,TIMEVALUE("17:00"))),0)

Do a custom number format of [MM] on the result cell.
 
Upvote 0
Just reviewed the data, and it looks like it works for some times but other it doesn't. For instance, for start and end times of 13:51 and 21:19, it returns a time 00:00, whereas with other times like 18:40(start) 20:13(end). Any ideas why?
 
Upvote 0
Just tried yours, and it returned all zeros. I put he formula in exactly as you wrote it. Is there something else I should have done?
 
Upvote 0
Does this work for you?

Excel Workbook
ABCD
1Surgery dateIn Room TimeOUt of Room TimeMinutes between 5-7 pm
207/01/201307:0016:590
307/01/201315:0018:3090
407/01/201318:2021:0040
507/01/201318:5921:301
607/01/201313:5121:19120
707/01/201318:4020:1320
Sheet1


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

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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