Display a date+x days, display next non-weekend date as result

0

I don't want to just count weekdays, I need x number of days from the date shown in a cell, and if that date is on a weekend (Saturday or Sunday), move it to the next Monday. In a perfect world, I'd also be able to accommodate the situation where, if the next Monday is a holiday, it'd push to the next non-holiday weekday, but I don't want to get too greedy.

For example, B10 shows a date. B20 shows the number of days until a deadline is reached. I want C20 to show the date of that deadline, unless that date is a Saturday, (in which case I want to add 2 days to the calculated date) or Sunday (in which case I want to add 1 day to the calculated date).

I'm using a Mac, if that has any importance.

Laurel Black

Posted 2016-10-15T15:52:36.540

Reputation: 1

I am neither psychic or a mind reader and I don't like guessing. What program are you using? Please [edit] the question and include this essential information. – DavidPostill – 2016-10-15T15:57:43.007

David, I added that I'm using Microsoft Excel. Thanks. – Laurel Black – 2016-10-15T15:59:08.743

Worksheet Functions For Dates And Times should get you started. – DavidPostill – 2016-10-15T16:06:31.210

Answers

1

This is the answer to your question:

=IF(WEEKDAY(B10+B20,2)<6;B10+B20;B10+B20+(8-WEEKDAY(B10+B20;2)))

How does it work?

You first test if your result is not a Saturday of Sunday. If it's not, you just add the number of days. If it is, you calculate how much days you have to add for it to be the next monday (this is the 8 I use) and add those days to the result.

Michthan

Posted 2016-10-15T15:52:36.540

Reputation: 466