# Current Week Formula

Options
edited 06/17/22

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)

• ✭✭✭✭✭✭
Options

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.

Sing Chen

Process Architect, Dayforce

• ✭✭✭✭✭✭
Options

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.

Sing Chen

Process Architect, Dayforce

• ✭✭✭✭✭✭
Options

It looks like you may be missing the second closing parenthesis after the TODAY function that will close out the YEAR function.

• Options

@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.

• ✭✭✭✭✭✭
Options

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!

Sing Chen

Process Architect, Dayforce

• ✭✭✭✭✭✭
Options

Try this:

=IF(AND(YEAR(Date@row) = YEAR(TODAY()), WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY()), 1)

• Options

@Sing C Thank you! It worked!

@Paul Newcome Your formula gave me the message "incorrect argument set"

• ✭✭✭✭✭✭
Options

@Megan Harry Its those pesky parenthesis...

=IF(AND(YEAR(Date@row) = YEAR(TODAY()), WEEKNUMBER(Date@row) = WEEKNUMBER(TODAY())), 1)

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!