Skip to content

Instantly share code, notes, and snippets.

@dancinllama
Created November 3, 2015 18:12
Show Gist options
  • Save dancinllama/ac8809adcd03efa2d0ab to your computer and use it in GitHub Desktop.
Save dancinllama/ac8809adcd03efa2d0ab to your computer and use it in GitHub Desktop.
IF(
OR(
ISBLANK(Available_From__c)
,Available_From__c < CASE(
MOD(TODAY() - DATE( 1900, 1, 7 ), 7 ),
2, TODAY() + 2 + 4,
3, TODAY() + 2 + 4,
4, TODAY() + 2 + 4,
5, TODAY() + 2 + 4,
6, TODAY() + 1 + 4,
TODAY() + 4
)
),
CASE(
MOD(TODAY() - DATE( 1900, 1, 7 ), 7 ),
2, TODAY() + 2 + 4,
3, TODAY() + 2 + 4,
4, TODAY() + 2 + 4,
5, TODAY() + 2 + 4,
6, TODAY() + 1 + 4,
TODAY() + 4
),
Available_From__c
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment