Skip to main content

I am calculating IT_Due_Date__c based on IT_Priority_Levels__c - but I need to skip weekends.

 

Here is my current formula (in the field IT_Due_Date_Calculation__c) (expected due dates vary since they are dependent on priority level)

 

CASE(IT_Priority_Levels__c,

"Low: Informational or personal procedure unusable, but workaround is possible", IT_Due_Date__c + 5,

"Normal: Non-critical function unusable, workaround is possible", IT_Due_Date__c + 3,

"Important: Critical function interrupted, no acceptable alternative", IT_Due_Date__c + 1,

"Critical: Major interruption affecting multiple functions. no possible alternatives", IT_Due_Date__c + 0,

NULL)

 

This formula does set the correct due date (adds 0, 1, 3, or 5 days to the date) but it does NOT skip weekends. I have found several different variations of formulas for skipping weekends, but I'm not sure how to incorporate it into this formula - or if I need another field to translate the IT_Due_Date__c into skipping weekends?

답변 8개
  1. 2022년 10월 5일 오후 10:54

    Ahhhh!  My bad, I fixed it

     

    IT_Due_Date__c +

    CASE( IT_Priority_Levels__c ,

    "Low: Informational or personal procedure unusable, but workaround is possible",

    CASE( WEEKDAY( IT_Due_Date__c ),

    1, 5,

    2, 7,

    3, 7,

    4, 7,

    5, 7,

    6, 7,

    7, 6,

    0),

    "Normal: Non-critical function unusable, workaround is possible",

    CASE( WEEKDAY( IT_Due_Date__c ),

    1, 3,

    2, 3,

    3, 3,

    4, 5,

    5, 5,

    6, 5,

    7, 4,

    0),

    "Important: Critical function interrupted, no acceptable alternative",

    CASE( WEEKDAY( IT_Due_Date__c ),

    1, 1,

    2, 1,

    3, 1,

    4, 1,

    5, 1,

    6, 3,

    7, 2,

    0),

    "Critical: Major interruption affecting multiple functions. no possible alternatives",

    0,

    NULL )