how to calculate difference in days between two dates that also contain time AND exlcuding weekends

skim22

New Member
Joined
Feb 28, 2018
Messages
2
Hi all, I have two cells which contains the date & time stamp in the following format: "mm/dd/yyyy hh:mm" - A2 contains the "create date" and B2 contains the "review date". What I want to do is see how many days have elapsed between the create & review date. I found a formula which neatly shows how many days, hours, and minutes have elapsed but this formula does not exclude weekends. The formula is below:

=INT(B2-A2)&" Days "&HOUR(MOD(B2-A2,1))&" Hour "&MINUTE(MOD(B2-A2,1))&" Minutes"

example returns "42 Days 4 Hour 36 Minutes"

Can this formula be edited to exclude weekends and still return the answer in the same format? Please help and thank you!!
 

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.
Code:
=NETWORKDAYS(B2, A2,2)&" Days "&HOUR(MOD(B2-A2,1))&" Hour "&MINUTE(MOD(B2-A2,1))&" Minutes"
This uses the NETWORKDAYS() function which uses (EndDate, StartDate, holidays) for arguments. So if you were checking from 1 January to present), there would be 2 holidays for the third argument as shown in the formula above.
 
Upvote 0
Code:
=NETWORKDAYS(B2, A2,2)&" Days "&HOUR(MOD(B2-A2,1))&" Hour "&MINUTE(MOD(B2-A2,1))&" Minutes"
This uses the NETWORKDAYS() function which uses (EndDate, StartDate, holidays) for arguments. So if you were checking from 1 January to present), there would be 2 holidays for the third argument as shown in the formula above.


Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,985
Members
449,201
Latest member
Lunzwe73

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