Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noeticpenguin/8872396 to your computer and use it in GitHub Desktop.
Save noeticpenguin/8872396 to your computer and use it in GitHub Desktop.
if (
and (
YEAR(Date_Start__c) == YEAR(TODAY()),
IF(
CEILING( ( Date_Start__c - DATE( YEAR( Date_Start__c ), 1, 1) + 1) / 7) > 52,
52,
CEILING( ( Date_Start__c - DATE( YEAR( Date_Start__c ), 1, 1) + 1) / 7)
) ==
IF(
CEILING( ( TODAY() - DATE( YEAR( TODAY() ), 1, 1) + 1) / 7) > 52,
52,
CEILING( ( TODAY() - DATE( YEAR( TODAY() ), 1, 1) + 1) / 7)
)
),
"1. This Week",
IF (Date_Start__c < TODAY(),
"0. Past",
if (
Date_Start__c - TODAY() < 91,
"2. Next 90 Days",
"3. Future"
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment