Find Hours lapsed from two Date with time stamp

shushilm

New Member
Joined
Oct 5, 2016
Messages
7
Hi All,

I need help with finding the hours lapsed with a formula or VBA. I have 100+ rows in excel where two columns have dates with time and I need the difference in business hours. It needs to exclude Weekends and US holidays while calculating the business hours it would be great (optional). Below is the example.

A B C
Date 1Date 2Business Hours Lapsed
3/30/2018 14:033/31/2018 19:29
Need the result in this column

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>

Thank you in advance,
Regards,
Shushil
 

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.
You could use the NETWORKDAYS function to calculate the difference (in days) between the two dates, excluding weekends and holidays (you will need to make a table with the list of US holidays), then multiple by the number of business hours per day. You would then need to adjust the result to cater for the number of business hours lapsed on the start and end dates.

There's some useful info and examples of NETWORKDAYS here.
 
Upvote 0
Thank you for the response. The problem comes with finding the hours form the format I provided, its date and time together. I am not able to split also, I will work on the working days, but I need to know how to take the difference in hours from the cell where its combine with Date and time.
 
Upvote 0
A date/time value consists of a whole number representing the date and a decimal representing the time. So, in cell A2, 3/30/2018 14:03 is actually interpreted by Excel as the number 43189.58542.

You can therefore extract the time element with the formula: =(A2-INT(A2))*24. This will produce the result 14.05 which is the decimal equivalent of 14 hours and 3 minutes. You can then subtract this from the end of the business day (e.g. if the end of the day is 9pm then you would subtract 14.05 from 21.00 to give 6.95 business hours).
 
Upvote 0

Forum statistics

Threads
1,215,123
Messages
6,123,183
Members
449,090
Latest member
bes000

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