# Color code record if due date is this week

Topic Labels: Base design
Solved
766 4
cancel
Showing results for
Did you mean:
4 - Data Explorer

Is it possible to color code a record based on a due date, but just the ones that are in the current week?

Example: Today is Thursday, so all the records with a today or tomorrow (Friday) due date would be colored red.

I know that color based on “within the next week” or “within X number of days” exists, but I need the records for the current week only.

Thanks!

1 Solution

Accepted Solutions
18 - Pluto

I would create a formula field that compares this week to the week of the due date like this:

``````IF(
WEEKNUM(TODAY()) = WEEKNUM({Due Date}),
"This Week"
)
``````

Then, you can color code based on the result of that formula.

4 Replies 4
18 - Pluto

I would create a formula field that compares this week to the week of the due date like this:

``````IF(
WEEKNUM(TODAY()) = WEEKNUM({Due Date}),
"This Week"
)
``````

Then, you can color code based on the result of that formula.

6 - Interface Innovator

This will work, though minor correction: WeekNum() is the formula to use. The following method also exists to get the week #, though is longer: DateTime_Format({Due Date}, “w”).

18 - Pluto

Oops, thanks for catching my mistake! :grinning: I just fixed it above!

4 - Data Explorer

Thank you Scott, the formula works.

It’s a bummer that it’s not an option in the Color code dialogue though.
I’ll just hide the formula column and pretend it doesn’t exist. :slightly_smiling_face: