Current Week Formula
I use the formula listed below quite often but sometimes different variations. I am having trouble with this specific one because it is pulling the previous year's entries as well when I only want the current year. I have tried a couple of things but can't seem to get the syntax right. I think I need to use something like YEAR(Date@row) = YEAR(TODAY() but can't seem to get it. Any suggestions? @Paul Newcome I think you were the one to help me with learning this formula a while back! Do you mind assisting? Thank you!
=IF(WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY()), 1)
Best Answer
-
Hi @Megan Harry,
I think you're almost there with the YEAR function. Give this a try:
=IF(YEAR(Date@row) = YEAR(TODAY()), "Current year so do something", "Not current year so don't do anything")
Thanks!
Let me know if that helps.
Answers
-
Hi @Megan Harry,
I think you're almost there with the YEAR function. Give this a try:
=IF(YEAR(Date@row) = YEAR(TODAY()), "Current year so do something", "Not current year so don't do anything")
Thanks!
Let me know if that helps.
-
It looks like you may be missing the second closing parenthesis after the TODAY function that will close out the YEAR function.
-
@Sing C @Paul Newcome my apologies because I don't think I explained my question well. I want the column to have a checkmark if they date falls within the current week of the current year. The formula I pasted above is pulling my current week for this year and last and I only want current year. I have been playing with something like this =IFYEAR(Date@row) = YEAR(TODAY()) +(WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY()), 1) but it isn't working.
-
Hi @Megan Harry ,
I'm with you now! Give this a try:
=IF(YEAR(Date@row) = YEAR(TODAY()), IF(WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY()), 1, 0), 0)
This checks if the year in the date is the current year, only then will it check if the week in the date is the current week. Anything else and the checkbox is left blank.
Hope that helps. Let me know if that's done the trick.
Thanks!
-
Try this:
=IF(AND(YEAR(Date@row) = YEAR(TODAY()), WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY()), 1)
-
@Sing C Thank you! It worked!
@Paul Newcome Your formula gave me the message "incorrect argument set"
-
@Megan Harry Its those pesky parenthesis...
=IF(AND(YEAR(Date@row) = YEAR(TODAY()), WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY())), 1)
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 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!