What is the formula for This week, Next week, etc.
I had formulas to check one of 5 checkbox columns if a specified date (Projected Start) fell within "Last week, this week, next week, this month, next month" based on todays date. (see attached)
=IFERROR(IF(WEEKDAY([Projected Start]@row) = 1, IF(AND(YEAR(TODAY()) = YEAR([Projected Start]@row), WEEKNUMBER(TODAY()) = WEEKNUMBER([Projected Start]@row + 1)), 1), IF(WEEKDAY([Projected Start]@row) > 1, IF(AND(YEAR(TODAY()) = YEAR([Projected Start]@row), WEEKNUMBER(TODAY()) = WEEKNUMBER([Projected Start]@row)), 1))), "")
As you can see in the screenshot, its not working. Can this formula be saved?
Answers
-
Without digging too deeply try pushing the +1 element outside of the date brackets.
so instead of WEEKNUMBER([Projected Start]@row + 1)) try WEEKNUMBER([Projected Start]@row) + 1)
=IFERROR(IF(WEEKDAY([Projected Start]@row) = 1, IF(AND(YEAR(TODAY()) = YEAR([Projected Start]@row), WEEKNUMBER(TODAY()) = WEEKNUMBER([Projected Start]@row + 1)), 1), IF(WEEKDAY([Projected Start]@row) > 1, IF(AND(YEAR(TODAY()) = YEAR([Projected Start]@row), WEEKNUMBER(TODAY()) = WEEKNUMBER([Projected Start]@row)), 1))), "")
Did that fix it?
Hope that helps
Thanks
Paul
-
Thanks Paul, no, I'm still getting the same result.
-
If I am understanding correctly I think it is the WEEKDAY part of your formula. The way your If formula is written it will only do the true value if the day of the week of the date in Projected Start is a Sunday I would try
This formula would be for last week
=If(YEAR([Projected Start date]@row=YEAR(TODAY(-7)),IF(WEEKNUMBER[Projected Start date]@row=WEEKNUMBER(TODAY(-7)),1,""),"")
This formula would be for this week
=If(YEAR([Projected Start date]@row=YEAR(TODAY()),IF(WEEKNUMBER[Projected Start date]@row=WEEKNUMBER(TODAY()),1,""),"")
This formula would be for next week
=If(YEAR([Projected Start date]@row=YEAR(TODAY(7)),IF(WEEKNUMBER[Projected Start date]@row=WEEKNUMBER(TODAY(7)),1,""),"")
This formula would be fore this Month
=IF(YEAR(Projected Start date]@row=Year(Today()),IF(MONTH([Projected Start date]@row=MONTH(Today()),1,""),"")
This formula would be for Next Month
=IF(YEAR(Projected Start date]@row=Year(Today()),IF(MONTH([Projected Start date]@row=MONTH(Today()+1),1,""),"")
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.4K Get Help
- 446 Global Discussions
- 144 Industry Talk
- 478 Announcements
- 5K Ideas & Feature Requests
- 85 Brandfolder
- 151 Just for fun
- 72 Community Job Board
- 490 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 302 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!