We work with data reports. Depending on the date the data is generated and the intended routing of the report, each report has milestone dates as it runs through the editing and QA processes. I created a spreadsheet which we all use to calculate our due dates at these various milestones. It's been working fine - until someone did something I never expected them to do!!
The formula in question is (for row 47):
=IF(ISERR(MATCH($F47,Class,0)),0,IF($D47>0,WORKDAY($D47,HLOOKUP($F47,WhenDue,2,FALSE),Holidays),""))
The start date is in D47
I use three named ranges of values to assist in calculating the milestone due dates:
-- Class gives us the intended routing: This value is in F47
-- WhenDue gives us the number of days to the milestone
-- Holidays is a list of dates that are removed from the date calculations for various company reasons. For instance, if there's a training day, we're not expected to move the report forward on that day, so we get a "freebie". If the result occurs on a Monday, and the normal routing would be due on Thursday, but we have a "freebie" on Tuesday, then routing is pushed back to Friday.
And here's where the "unexpected flaw" comes in. The formula works great -- AND THEN ....
We had data generated on a "freebie" day. The expectation was that, because this specific date is included in the Holidays range listing, it would be ignored and the due date pushed back. To use the example above:
If the result occurred on Monday, with a "freebie" on Tuesday, routing shows as Friday as expected.
If the result occurred on the Tuesday freebie day, we would ~~expect~~ the routing milestone to push to Monday (since WORKDAY excludes weekends).
Instead, we see the milestone on Friday.
So it seems like I need a way to detect if the date in D7 is included in the Holidays table, and if so increment the date until it's valid. Or something like that?? What would be the easiest way to adjust this to give the result we need?
The formula in question is (for row 47):
=IF(ISERR(MATCH($F47,Class,0)),0,IF($D47>0,WORKDAY($D47,HLOOKUP($F47,WhenDue,2,FALSE),Holidays),""))
The start date is in D47
I use three named ranges of values to assist in calculating the milestone due dates:
-- Class gives us the intended routing: This value is in F47
-- WhenDue gives us the number of days to the milestone
-- Holidays is a list of dates that are removed from the date calculations for various company reasons. For instance, if there's a training day, we're not expected to move the report forward on that day, so we get a "freebie". If the result occurs on a Monday, and the normal routing would be due on Thursday, but we have a "freebie" on Tuesday, then routing is pushed back to Friday.
And here's where the "unexpected flaw" comes in. The formula works great -- AND THEN ....
We had data generated on a "freebie" day. The expectation was that, because this specific date is included in the Holidays range listing, it would be ignored and the due date pushed back. To use the example above:
If the result occurred on Monday, with a "freebie" on Tuesday, routing shows as Friday as expected.
If the result occurred on the Tuesday freebie day, we would ~~expect~~ the routing milestone to push to Monday (since WORKDAY excludes weekends).
Instead, we see the milestone on Friday.
So it seems like I need a way to detect if the date in D7 is included in the Holidays table, and if so increment the date until it's valid. Or something like that?? What would be the easiest way to adjust this to give the result we need?