Number formatting query for a formula returning a duration of more than 24 hours.

NewOrderFac33

Well-known Member
Joined
Sep 26, 2011
Messages
1,275
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
Good afternoon,

I came across Barry Houdini's formula to use NetWorkDays with some additional parameters ro allow you to work out the amount of elapsed "working" time between two date/times thus:
Code:
=(NETWORKDAYS(B6,C6)-1)*("6 PM"-"9 AM")+MOD(C6,1)-MOD(B6,1)
where B6 is the Start Time, C6 is the End Time, "6 PM" is the end of the working day and "9 AM" is the start of the working day (no, I don't know how he worked it out, either!)

For my example, I use:
Code:
[h]" hrs":mm" mins "
to format the results.

With a start date of Monday 09/09/13 16:00 and an end date of Tuesday 10/09/2013 10:15 I get a correct result of 3 hrs 15 minutes (Mon 16:00-18:00 + Tue 09:00-10:15)

However, when the durations exceed 24 hours, although the numbers of hours and minutes returned are correct, what I really want to see is (for example)

Start Time Monday 09/09/2013, End Time Wednesday 11/09/2013 18:00 showing as "01 days 03 hrs 00 mins" instead of "27 hrs 00 mins"

Is this even possible?

As usual, thanks in advance.

Pete
 
Last edited:

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.
Thanks for your assistance, which made me realise that my question was dumb in the first place as if I'm trying to calculate working hours only, any display of "days" is actually meaningless!
It's amazing what a good night's sleep will do..!
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,024
Members
449,092
Latest member
ikke

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