How to calculate business hours/minutes between two dates?

hardtoguess

New Member
Joined
Aug 8, 2018
Messages
2
I'm trying to calculate business hours between 7PM and 7AM.

For Example I have a below dataset

Start time <code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">2018-01-10 19:15:00</code> and End time <code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">2018-01-11 09:00:00</code>.
Start time <code style="font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; padding: 1px 5px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">2018-01-06 11:30:00</code> and End time <code style="font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; padding: 1px 5px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">2018-01-06 22:10:00</code>.
Start time <code style="color: rgb(36, 39, 41); font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; padding: 1px 5px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">2018-01-07 15:30:00</code> and End time <code style="color: rgb(36, 39, 41); font-style: inherit; font-variant: inherit; font-weight: inherit; margin: 0px; padding: 1px 5px; border: 0px; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">2018-01-07 20:00:00</code>.


I expect calculation to return how many hours between 7PM and 7AM.



Thanks.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
This ??

Excel 2007
ABC
210/01/2018 19:1511/01/2018 9:0013.75
36/01/2018 11:306/01/2018 22:0010.5
47/01/2018 15:307/01/2018 20:004.5
57/01/2018 16:008/01/2018 3:3011.5
Sheet1
Cell Formulas
RangeFormula
C2=(B2-A2+(B2))*24
C3=(B3-A3+(B3))*24
C4=(B4-A4+(B4))*24
C5=(B5-A5+(B5))*24
 
Last edited:
Upvote 0
Hi Michael,

Thanks for reply.
But I want to see only the Hours between 7pm and 7am.

Output I am looking for as below


210/01/2018 19:1511/01/2018 9:0011.75
36/01/2018 11:306/01/2018 22:003
47/01/2018 15:307/01/2018 20:001
57/01/2018 16:008/01/2018 3:308.5

<thead>
</thead><tbody>
</tbody>

****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">ABC210/01/2018 19:1511/01/2018 9:0013.7536/01/2018 11:306/01/2018 22:0010.547/01/2018 15:307/01/2018 20:004.557/01/2018 16:008/01/2018 3:3011.5</body>Sorry for formatting!
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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