function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nicole Chang_Nicole Chang_ 

Formula to calculate task due date

Hi, 
I am trying to create formula to calculate task due date based on few scenerios:
Task due date if call 1 = TODAY, call 2 = TODAY + 24 hours, call 3= TODAY + 48 hours, and
1. if lead owner in EU --> work from Monday til Friday
2. if lead owner in Asia --> work form Tuesday til Saturday

So far I've been trying with this but cant seem to work (logic of weekday: 1-Sunday, 2-Monday, ... 7-Saturday)

IF ({!$Record.Country} = "Europe" || {!$Record.Country} = "UK" &&           {!$Record.Week_Day__c} = 1, TODAY() + 1,                   {!$Record.Week_Day__c}= 7, TODAY() +2), TODAY()

IF {!$Record.Country} = "Asia" && (IF ({!$Record.Week_Day__c} = 2, TODAY() + 1, {!$Record.Week_Day__c}=1, TODAY() +1), TODAY()

Please help :((
Shri RajShri Raj
To create a formula that calculates the task due date based on your specified scenarios, you can use a combination of IF and DATE functions. For example,

IF({!$Record.Country} = "Europe", 
    IF(WEEKDAY(TODAY()) = 2, 
        TODAY() + 1, 
        IF(WEEKDAY(TODAY()) = 6, 
            TODAY() + 3, 
            TODAY() + (2 - WEEKDAY(TODAY())))
    ),
    IF({!$Record.Country} = "Asia",
        IF(WEEKDAY(TODAY()) = 3, 
            TODAY() + 1, 
            IF(WEEKDAY(TODAY()) = 7, 
                TODAY() + 4, 
                TODAY() + (3 - WEEKDAY(TODAY())))
        ),
        IF(WEEKDAY(TODAY()) = 1, 
            TODAY() + 1, 
            IF(WEEKDAY(TODAY()) = 7, 
                TODAY() + 2, 
                TODAY() + (1 - WEEKDAY(TODAY()))))
    )
) + IF( {!$Record.Call_number__c} = 1, 0, 
        IF( {!$Record.Call_number__c} = 2, 1, 
            IF( {!$Record.Call_number__c} = 3, 2, 0)
        )
    )
 
zin paszin pas
Skims have become my new go-to when it comes to shapewear. Keep reading to learn more about skims return policy and what you can expect if you are looking for a refund. https://returnpolicy.me/skims/