Help with text formula based on date range
I'm trying to create a formula that essentially does this:
If [Due Date]@row occurs next week then "Next Week"
ELSEIF [Due Date]@row occurs last week then "Last Week"
I was initially doing this with WEEKNUMBER, but that doesn't work when today and due date are in different years. I then tried doing date math by comparing due date to TODAY() and then generating the value based on those numeric ranges, but I'm having trouble getting it right because the "range' of this week and next week shifts depending what "today" is.
Thanks for any help!
Craig
Answers
-
I figured it out
=IF(Status@row = "Complete", "Complete",
IF(ISBLANK([Due Date]@row), "No Due Date",
IF(WEEKNUMBER([Due Date]@row) = WEEKNUMBER(TODAY()), "This Week",
IF(AND(WEEKNUMBER([Due Date]@row) = 1, WEEKNUMBER(TODAY()) = 52), "Next Week",
IF(WEEKNUMBER([Due Date]@row) = WEEKNUMBER(TODAY()) + 1, "Next Week",
IF(AND(WEEKNUMBER([Due Date]@row) = 52, WEEKNUMBER(TODAY()) = 1), "Last Week",
IF(WEEKNUMBER([Due Date]@row) = WEEKNUMBER(TODAY()) - 1, "Last Week",
IF([Due Date]@row - TODAY() >= 8, "More than 1 week in future",
IF([Due Date]@row - TODAY() <= -8, "More than 1 week overdue")))))))
-
Hey @Craig H - thanks for posting your solution!
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!