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
swapna muthiyaluswapna muthiyalu 

CASE( MOD(TODAY() - DATE(1900, 1, 7), 7), 3, TODAY() + 2 + 3, 4, TODAY() + 2 + 3, 5, TODAY() + 2 + 3, 6, TODAY() + 1 + 3, TODAY() + 3 ), can anyone explain this formula?

Best Answer chosen by swapna muthiyalu
Maharajan CMaharajan C
Hi Swapna,

If today() = 3,Wednesday = add 3 days = Monday      (exclude Saturday,Sunday = 2days).
If today() = 4,Thursday     = add 3 days = Tuesday      (exclude Saturday,Sunday = 2 days).
If today() = 5,Friday          = add 3 days = Wednesday (exclude Saturday,Sunday  = 2days).
If today() = 6,Saturday      = add 3 days = Wednesday (exclude Sunday  = 1days).


Case else logic:
If today() =  monday = just  add 3 days = Thursday    ( no need to exclude Saturday,Sunday = 2days).
If today() =  Tuesday =just   add 3 days = Friday        (no need  to exclude Saturday,Sunday = 2days).

Can you please Let me know if it helps or not!!!

If it helps don't forget to mark this as a best answer!!!


Thanks,
​Raj

All Answers

Maharajan CMaharajan C
Hi Swapna,

The formula exclude the weekends and add the three days:

If the Today is wednesday then it will add the 3 days that is thursday,Friday then display the date as Monday which ecxlude the Satuday and Sunday.

CASE( MOD( date - DATE( 1900, 1, 7 ), 7 ), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5, "Friday", "Saturday" )

Can you please Let me know if it works or not!!!

If it helps don't forget to mark this as a best answer!!!


Thanks,
​Raj
swapna muthiyaluswapna muthiyalu
Hi Raj, Thanks for the reply, but if its wednesday(3, TODAY() + 2 + 3), we are adding Thursday and friday, leaving saturday n sunday we add 3 days, when its Thursday (4, TODAY() + 2 + 3,) why we need to add 2 days we have to add only 1 + 3 and again it its friday ( 5, TODAY() + 2 + 3,), we have to add  just 3 then, can u explain on this more?
 
Maharajan CMaharajan C
Hi Swapna,

If today() = 3,Wednesday = add 3 days = Monday      (exclude Saturday,Sunday = 2days).
If today() = 4,Thursday     = add 3 days = Tuesday      (exclude Saturday,Sunday = 2 days).
If today() = 5,Friday          = add 3 days = Wednesday (exclude Saturday,Sunday  = 2days).
If today() = 6,Saturday      = add 3 days = Wednesday (exclude Sunday  = 1days).


Case else logic:
If today() =  monday = just  add 3 days = Thursday    ( no need to exclude Saturday,Sunday = 2days).
If today() =  Tuesday =just   add 3 days = Friday        (no need  to exclude Saturday,Sunday = 2days).

Can you please Let me know if it helps or not!!!

If it helps don't forget to mark this as a best answer!!!


Thanks,
​Raj
This was selected as the best answer
swapna muthiyaluswapna muthiyalu
Thank you Raj. Its clear now.