Jump to content

Subtracting Days from a Deadline


This topic is 5652 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Meant to put this in Define Fields.

OK. I looked through the posts and can't figure this one out.

I have one date, a Deadline date, and need to show the date 3 days prior from that date.

The problem is I can't include weekend days.

All the formulas I have seen are based off of a start and end date.

Even when I reference a field (end date) that takes the Deadline and subtracts 3 days it doesn't worked.

Thanks for any help. I am sure I am missing something.

Edited by Guest
Link to comment
Share on other sites

Here is a formula that will allow you to specify a Start Date and a number of days:

Start Date +

Div(Days; 5) * 7 +

Middle("12345012340123601256014560345623456"; (DayofWeek(Start Date) - 1) * 5 + Mod(Days; 5) + 1; 1)

You need to make sure the Start Date falls on a week day date.

The series of numbers included in the middle function represent the number of days you need to add to each day of the week in order to make it a week day. For example, the first 5 digits refer to Sunday (12345). Adding 1 day to Sunday makes it Monday, adding 2 days makes it Tuesday, etc. The next 5 digits refer to Monday (01234). Adding 0 days makes it Monday, adding 1 day makes it Tuesday, etc. The next 5 digits represent Wednesday (01236). The jump from three to six represents the weekend (i.e. 4, 5).

Link to comment
Share on other sites

If you are willing to hardcode the number -3 into the formula, you could use a simple mini-lookup like this:

Deadline - Middle ( "4555333" ; DayOfWeek ( Deadline ) ; 1 )

Very much like John Mark's formula above, it simply pre-computes the number of days you need to subtract, depending on the day-of-week of deadline (here the deadline is allowed to fall on the weekend).

For a more general formula, see here.

Link to comment
Share on other sites

This topic is 5652 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.