Checking Boxes if Date is Current Week

I am trying to develop a formula to check the box if the Date is today or within the last week(6 days). The formula that I have so far is
=IFERROR(IF(AND(Date@row >= TODAY() - WEEKDAY(TODAY(), 1), Date@row <= TODAY() + (6 - WEEKDAY(TODAY(), 7))), 1, 0), "")
However, the box is not checking.
Answers
-
hi, @ldavies95 -
I wonder if you may want to use the WORKDAY function (instead of WEEKDAY.
The WORKDAY function returns a date within a specified number of work days, and does not count Saturday and Sunday. The WEEKDAY function is different - it will return a number representing the day of the week. If you're looking to identify dates within the past 6 working days, the WORKDAY function should do the trick. :)
You could try something like this:
=IF(AND([Date@row < TODAY(), Date@row >= WORKDAY(TODAY(), -6)), 1, 0)
This formula will check a box if the Date cell is in the past (<TODAY) and is in the last 6 working days.
Does this help?
Help Article Resources
Categories
Check out the Formula Handbook template!