• Jordan Donolow
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hey all,

Hope all is well! I wanted to ask for a huge favor here with the workday formula.

I am looking for a formula that will calculate 6 days in the past from the start date.

Out of the 6 total count days:
Day 0: cannot count Saturday, Sunday or Holiday's
Day 1-3: cannot count Sunday or Holiday's
Day 4-6: cannot count Saturday, Sunday or Holiday's

However, the final result can only land on a Monday-Friday and not on a holiday, saturday or sunday

So if it did land on a Holiday, Saturday or Sunday, the end date would revert to the previous workday

Example:
If start date is 1/18/2022, should return 1/7/2022, NOT 1/10/2022
Day 0: 1/7 (return date) since Day 0 cannot be a Sunday (see above), so the return date should revert to the previous workday (1/7/2022)
Day 1: 1/10
Day 2: 1/11
Day 3: 1/12
Day 4: 1/13
Day 5: 1/14
Day 6: 1/18 (start date)

1/15 doesnt count since its a Saturday
1/16 doesnt count since its a Sunday
1/17 doesnt count since its a Holiday (MLK Jr)

Here is the WORKING formula in excel: 
=if(B7="CA", WORKDAY(WORKDAY.INTL(WORKDAY(AF7,-3,$A$2:$A$13),-3,11,$A$2:$A$13)+1,-1,$A$2:$A$13), AF7-4)
 

In the Loan Object in Salesforce:

B7 = ‘Property State’ loan field 

AF7 = ‘Close of Escrow’ loan field

$A$2:$A$13 = Current Holiday Date List below:

1/17/2022 MLK
2/21/2022 Presidents
5/30/2022 Memorial
6/20/2022 Juneteenth
7/4/2022 Independence
9/5/2022 Labor Day
10/10/2022 Columbus
11/11/2022 Veterans
11/24/2022 Thanksgiving
11/25/2022 Day After Thanksgiving
12/26/2022 Christmas
1/2/2023 New Years
 
Would want to translate this formula into a Salesforce formula

Your help would be greatly appreciated!!