Reversing WEEKNUMBER Function

Hi all,
I have a few values corresponding to different dates, and I would like to group these dates by their respective weeks. What I am thinking of doing is using the WEEKNUMBER function to generate what week they are in, and then grouping them using this number. Additionally however, I would like to group them by the weeks they are in. Moreover I would like for those weeks to be represented by the Friday, and NOT by the Monday or Sunday. Is there any function that brings me close to this point, or any function that does what I am looking to do? Any help would go a long way and be greatly appreciated. Thank you all in advance!
Best Answer
-
Hi @Muhammad
You can use an IF statement to check what day of the week your date is. Then if it's a Friday, Saturday, or Sunday, you can add 1 to the WeekNumber so that the week starts on the Friday.
For example:
=IF(OR(WEEKDAY(Date@row) = 1, WEEKDAY(Date@row) = 7, WEEKDAY(Date@row) = 6), WEEKNUMBER(Date@row) + 1, WEEKNUMBER(Date@row))
Then you can use this column to Group in a Report. Is this what you were looking to do?
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
Answers
-
Hi @Muhammad
You can use an IF statement to check what day of the week your date is. Then if it's a Friday, Saturday, or Sunday, you can add 1 to the WeekNumber so that the week starts on the Friday.
For example:
=IF(OR(WEEKDAY(Date@row) = 1, WEEKDAY(Date@row) = 7, WEEKDAY(Date@row) = 6), WEEKNUMBER(Date@row) + 1, WEEKNUMBER(Date@row))
Then you can use this column to Group in a Report. Is this what you were looking to do?
Cheers,
Genevieve
Need more information? 👀 | 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
- 67.1K Get Help
- 448 Global Discussions
- 154 Industry Talk
- 504 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 80 Community Job Board
- 513 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!