# Discussions

View Only

## How to calculate a date for this Friday if date is before Thursday or for the following Friday if date is Thursday or Friday

• #### 1.  How to calculate a date for this Friday if date is before Thursday or for the following Friday if date is Thursday or Friday

Posted 06-15-2017 17:52
I want to create a formula date field for client payments when the job completion date is entered. How can I calculate if the [Task Completion Date] is on a Monday, Tuesday, or Wednesday, then the date should be Friday of that same week. If the date is on a Thursday or Friday then the date should be the Friday of the following week. Searched for ideas but couldn't find anything. Any assistance would be much appreciated. Thanks!

• #### 2.  RE: How to calculate a date for this Friday if date is before Thursday or for the following Friday if date is Thursday or Friday

Posted 06-15-2017 18:00
Try this:
`If(  DayOfWeek([Task Completion Date])=1 or  DayOfWeek([Task Completion Date])=2 or  DayOfWeek([Task Completion Date])=3,  FirstDayOfWeek([Task Completion Date])+Days(5),  FirstDayOfWeek([Task Completion Date])+Days(12)  )`

• #### 3.  RE: How to calculate a date for this Friday if date is before Thursday or for the following Friday if date is Thursday or Friday

Posted 06-15-2017 18:06
Genius Dan! Worked like a charm. Thanks so much!!! I had something similar but was missing the "FirstDayOfWeek" part.