I have a date in column H10 and need to add 45 days to this date in the next Column I
- If there are not dates Column I must be blank
- If the 45th day falls on a weekend the calculation must move to the next workday which is Monday
I have a date in column H10 and need to add 45 days to this date in the next Column I
You can combine the functions for IF(), WEEKDAY() and WORKDAY() to calculate your finish date and ensure that it does not fall on a weekend.
I've used
You need to combine two fundamental functions.
First,
DATE + INT = DATE
. For example, ifH10 = 1/8/2015
andH11 = H10 + 10
then H11 will show1/18/2015
.In your case, you want to use
H10 + 45
.Second, you can use the
Weekday(date,mode)
function to determine the day of the week. Personally, for your purpose, you could useweekday(h10 + 45, 2)
which would give a 1-5 for MTWRF, and a 6-7 for a weekend day. So something likeBut we aren't done yet - you need to make sure your day actually ends up on a weekday. So we can do something like this - when determining a weekday, we can use that to determine how much we need to add. If we end up with a 6 (Saturday) we want to add 2 days to push it to a Monday. In the case of a 7, we want to add 1 day to push it to a Monday. Thus, we can simply take the
8 - weekday(h10+45)
to add when it's a weekday. So our add value becomesYou also have a requirement about being blank, so you'll want to wrap whatever you use with