Date difference excluding days of week

Quarius

New Member
Joined
Oct 29, 2015
Messages
2
Hi,


I have two dates, the start date and the end date. I need to calculate the exact date difference between them but excluding specific days of week. For example:


Start date: 2015-10-06 11:00 AM
End date: 2015-10-29 18:55 PM


And all of Wednesdays and Fridays need to be excluded (Start date and End date cannot occur in the excluded days).


How to achieve such thing without VBA using Excel 2007?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Welcome to the MrExcel forum!

Kind of tricky, but I think this works:

<weekday(l10,13),1,0)-if(weekday(l11,15)<weekday(l10,15),1,0)
<weekday(l10,13),1,0)-if(weekday(l11,15)<weekday(l10,15),1,0)
=DATEDIF(L10,L11,"d")-2*INT(DATEDIF(L10,L11,"d")/7)-IF(WEEKDAY(L11,13) < WEEKDAY(L10,13),1,0)-IF(WEEKDAY(L11,15) < WEEKDAY(L10,15),1,0)

Where the start date is in L10 and the end date is in L11. I've tested it and it seems to work for me. Try it and see if it meets your needs and let me know.</weekday(l10,13),1,0)-if(weekday(l11,15)<weekday(l10,15),1,0)
</weekday(l10,13),1,0)-if(weekday(l11,15)<weekday(l10,15),1,0)
 
Upvote 0
Hello Eric!

Thanks for the response. Unfortunately, in the Excel 2007 WEEKDAY doesn't support parameters 11-17 (Look here).

But I've managed to create a solution based partially on this post.

Assuming the start date is in A1 and the end date is in B1 and I want to exclude (for example) Wednesdays and Fridays, the formula looks like this:

Code:
=B1-A1-(INT((WEEKDAY(A1-3,2)-A1+B1)/7)+INT((WEEKDAY(A1-5,2)-A1+B1)/7))
 
Upvote 0
It is tricky trying to keep track of what version supports what options.

I am glad you figured it out though. Well done!
 
Upvote 0

Forum statistics

Threads
1,213,581
Messages
6,114,445
Members
448,573
Latest member
BEDE

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