Current Week for Period
I'm trying to use a formula to identify the "Current Week" in my file. The file calculates the reporting period based on the date the new row is created. It also calculates the reporting week number based on the period ending date. The issue is that when I use the WEEKNUMB function to calculate the "Current Week" it does not work on Sundays. It actually leaves that cell blank. I'm using the following formula:
=IF(AND(Year@row = "Current Year", WEEKNUMBER(Added@row) -1 = [Week Number]@row), "Current Week")
Answers
-
Hi, @Cesar Perez , WEEKNUMBER() is based on Mondays. This year, January 1 falls on a Sunday so WEEKNUMBER() calculates 1/1/2023 as week 52 for 2022.
If a date falls on Sunday, you can increment it by 1 day, "+1", so that it matches your reporting period weeks.
WEEKNUMBER(
IF(WEEKDAY(Added@row)=1, Added@row + 1, Added@row)
)= IF(AND(Year@row = "Current Year", WEEKNUMBER(IF(WEEKDAY(Added@row)=1, Added@row + 1, Added@row))-1 = [Week Number]@row), "Current Week")
-
Thank you @Toufong Vang. Unfortunately your solution made all the entries in this year as "Current Week". only the period in week #2 should be "Current Week" from 1/8/23-1/14/23. The period date is based on when the row was added. The new upcoming period is 1/15/23-1/21/23. That period will be added on Sunday, 1/22/23. At that time. that row should be the "Current Week". I am stomped on this case.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 137 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!