Date and Time

nianchi111

Board Regular
Joined
Aug 24, 2007
Messages
197
Office Version
  1. 365
Dear friends,

I have to prepare a report and I'm not getting the calculation correct.

I have 2 timings I have to subtract and get the actual time taken to complete that work.

If I receive the email atfer 5:30 pm it should show as next day 9:00 am and if I receive a mail on friday after 5.30 it should show the time as Monday 9.00 am. Please help me this is a manual work for me.

I will give you some of the time from the report.

19/08/2011 10:21 22/08/2011 09:55
17/08/2011 13:41 18/08/2011 14:07
17/08/2011 13:18 18/08/2011 14:43
16/08/2011 15:55 18/08/2011 15:40
16/08/2011 12:19 19/08/2011 14:34
16/08/2011 10:53 18/08/2011 15:40
16/08/2011 10:14 17/08/2011 10:25
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Give this formula a try - not fully tested, but I think it will do what you want, it assumes your two times are in columns A and B respectively:

Code:
=TEXT(IF(NETWORKDAYS(A2,B2)=1,B2-A2,((INT(A2)+TIME(17,0,0))-A2)+(B2-(INT(B2)+TIME(9,0,0)))+(TIME(8,0,0)*((NETWORKDAYS(A2,B2))-2))),"[hh]:mm:ss")
 
Last edited:
Upvote 0
For 18/08/2011 12:46 19/08/2011 10:24 result is "#NAME?".

How to change to 17:30:00

Please help me.
 
Upvote 0
Is it possible that you could receive an eamil at 07:00 on Tuesday and complete the work at noon that day? If so the time taken is 3:00 isn't it?

This formula will give that result

=(NETWORKDAYS(A2,B2)-1)*("17:30"-"9:00")+MOD(B2,1)-MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),"17:30","9:00")

assumes that email can arrive at any time but that it will be completed within business hours

format result cell as [h]:mm
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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