Help with cross year Working week formula

Dave Mex
Dave Mex ✭✭✭
edited 07/12/24 in Formulas and Functions

Hello Everyone. I'm after help making this work in a single column if possible

BROKE.PNG

I'm wanting to create a Due Column that will tell you if the end date of the task you are working on is in "This week", "Next Week" or "Beyond". The problem occurs when the task runs from December to January. As you can see from the above it gives an incorrect return. The Formula I'm using is.

=IFERROR(
IF(AND(WEEKNUMBER([End Date]@row) <= WEEKNUMBER([Working Day]@row), YEAR([End Date]@row) = YEAR([Working Day]@row)), "This Week",
IF(AND(WEEKNUMBER([End Date]@row) = (WEEKNUMBER([Working Day]@row) + 1), YEAR([End Date]@row) = YEAR([Working Day]@row)), "Next Week",
IF(AND(WEEKNUMBER([End Date]@row) = (WEEKNUMBER([Working Day]@row) + 2), YEAR([End Date]@row) = YEAR([Working Day]@row)), "2 Weeks Out",
IF(AND(WEEKNUMBER([End Date]@row) >= (WEEKNUMBER([Working Day]@row) + 3), YEAR([End Date]@row) >= YEAR([Working Day]@row)), "Due Beyond")))), "error")

I have worked on the below formula that gives me the week number when across this time frame but I'm struggling in incorporating it into my current formula.

=IF(YEAR([End Date]@row) > YEAR([Working Day]@row), (WEEKNUMBER([End Date]@row) + 52) - WEEKNUMBER([Working Day]@row), WEEKNUMBER([End Date]@row) - WEEKNUMBER([Working Day]@row))

This can be made to work with a support column or support sheet. However these reports are very large so I'm after saving bandwidth. And need it to work within one column formula.

Any help would me much appreciated.

Tags:

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!