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

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
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!
Photo of Dawn Rene

Dawn Rene

  • 404 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Dan

Dan

  • 1,180 Points 1k badge 2x thumb
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)
)
Photo of Dawn Rene

Dawn Rene

  • 404 Points 250 badge 2x thumb
Genius Dan! Worked like a charm. Thanks so much!!! I had something similar but was missing the "FirstDayOfWeek" part.