Formula About Manhours

nazarene

New Member
Joined
Jun 25, 2015
Messages
43
Office Version
  1. 365
Platform
  1. Windows
Good day
Can you please help me to make a formula related as per below table, now I am manually doing the process,
the logic is like this, I would like to get only the hours spent from the range of 9:00pm to 6:00am.

For example:
In item # 1- The workers starts to work from 6:27am until 10:09pm so the 9pm to 10:09pm equal hours spent will be 1 hours and 9 minutes
In item # 2 - The Workers starts to work from 4:15am until 12:17pm so the 4:15am to 6:00am equal hours spent will be 1 hours and 45 minutes


1630464343922.png



Thank you and best regards
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Thank you for the link thread sir, but i have difficulty to apply such example to my file :),
can you please give me a sample formula as per table i showed to you
 
Upvote 0
Hi,

Take a look at this:

networkdays.intl.xlsx
ABCDEFGHIJ
1ItemDateStart TimeDateFinish Timeexclude06:00:0021:00:00
2126-6-202106:27:4626-6-202122:09:5901:09:59
3227-7-202104:15:4727-7-202112:17:2501:44:13
4327-7-202103:45:2027-7-202113:28:1502:14:40
5426-6-202106:27:3926-6-202122:09:5301:09:53
6527-7-202103:54:2027-7-202112:05:4202:05:40
Sheet1
Cell Formulas
RangeFormula
F2:F6F2=(((B2+IF(E2<C2,$J$2,E2))-(B2+C2)+((D2+IF(E2<C2,$J$2,E2))<(B2+C2))))-IFERROR(((NETWORKDAYS.INTL((B2+C2),(B2+(E2<C2)+E2),"0000000")-1)*($J$1-$I$1)+IF(NETWORKDAYS.INTL((IF(E2<C2,B2+1,B2)+E2),(IF(E2<C2,B2+1,B2)+E2),"0000000"),MEDIAN(MOD((IF(E2<C2,B2+1,B2)+E2),1),$J$1,$I$1),$J$1)-MEDIAN(NETWORKDAYS.INTL((B2+C2),(B2+C2),"0000000")*MOD((B2+C2),1),$J$1,$I$1)),0)
 
Upvote 0
Thank you for your help sir, It works perfectly.

Thank you and god bless.
 
Upvote 0
A small correction:

networkdays.intl.xlsx
ABCDEFGHIJ
1ItemDateStart TimeDateFinish Timeexclude06:00:0021:00:00
2126-6-202106:27:4626-6-202122:09:5901:09:59
3227-7-202104:15:4727-7-202112:17:2501:44:13
4327-7-202103:45:2027-7-202113:28:1502:14:40
5426-6-202106:27:3926-6-202122:09:5301:09:53
6527-7-202103:54:2027-7-202112:05:4202:05:40
Sheet1
Cell Formulas
RangeFormula
F2:F6F2=(((B2+IF(E2<C2,$J$2,E2))-(B2+C2)+((D2+IF(E2<C2,$J$2,E2))<(B2+C2))))-((NETWORKDAYS.INTL(B2&C2,D2&E2,"0000000")-1)*($J$1-$I$1)+IF(NETWORKDAYS.INTL(D2&E2,D2&E2,"0000000"),MEDIAN(MOD(D2&E2,1),$J$1,$I$1),$J$1)-MEDIAN(NETWORKDAYS.INTL(B2&C2,B2&C2,"0000000")*MOD(B2&C2,1),$J$1,$I$1))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,981
Messages
6,175,768
Members
452,668
Latest member
mrider123

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