I have created a spreadsheet in Google Drive for my travel planning. In this table I would like to use conditional formatting. The field contains the date until which a free cancellation of the hotel is possible. I would like to change the font and the text color.
Case 1: I have more than 14 days until the date
Case 2: I have 14 days or less left
Case 3: it is the day or it is in the past.
I have tried, but my attempts have not resulted in any change to the font color.
Thanks for your help
if A column holds your dates use custom formula in conditional formatting:
green:
=A1>TODAY()+14
yellow:
=(A1<TODAY()+14)*(A1>TODAY())
red:
=((A1=TODAY())+(A1<TODAY()))*(A1<>"")
Related
I have an Access DB I've been working on that tracks the preconstruction work for each project we are awarded. I've included a form that is a quick glance at the status of some of the initial tasks that need to be performed. The data source is a query that includes the award date and fields that calculate dates for each of the initial tasks. On the form, under each task I have a textbox tied to the calculated date and a checkbox tied to another field in the query indicating if the task is complete or not.
I've added conditional formatting to the textboxes to give a quick visual of what the status of each task is. The first two conditional formats appear to work fine:
If there is no start date entered, the background and text are white.
If the box is checked as complete, the background and text are green.
Where I am running into issues is with the last four conditional formats:
If the date is in the past, the background is red.
If the date is in the next week, the background is orange.
If the date is between one and two weeks out, the background is yellow.
If the date is more than two weeks out, the background is white.
In the screen shot attached, you can see the issues. The date the screen shot was taken was 5/21/2021. One textbox with 5/3/2021 as the date is formatting as being within the next week even though it's in the past. Some dates that are over a month away are formatting as being within the next week.
Any suggestions?05.21.2021 Screenshot
You don't have date values, but expressions interpreted as numbers. Thus:
5/21/2021 = 1.17810607667114E-04
5/3/2021 = 8.246742536698E-04
So, go back and make sure you pass date values from the table/query all the way to the form's textboxes.
And, when done, adjust your first condition to:
Value Is Null
Now() returns date + time. Use Date() instead to work with the date only.
Since the rules are applied in sequence, only the first one matching condition applies. Therefore it is not necessary to use Between And.
My suggestion, where white is the default formatting of the textbox, and therefore does not require a condition.
Expression Is [checkbox_name] ---> green
Value < Date() ---> red
Value < Date() + 8 ---> orange
Value < Date() + 15 ---> yellow
Using Google Sheets, I am trying to figure out how to count the number of values that fall in a specific date range (within a week of today). In column A I have dates, and column B I have fruits. I want to see how many bananas are within a week of Today (ex. Today minus 7 days).
See attached picture with my layout.
Currently I am using the formula:
=countifs(B2:B21, "Banana", A2:A21, (B23-7))
where B23 is today's date. The formula says there's only 1 Banana value, when I know there should be more.
You would need to slightly adjust your formula to:
=COUNTIFS(B2:B21, "Banana", A2:A21, ">"&B23&-7)
If you want to always get last week's count, you could use the following
=COUNTIFS(B2:B21, "Banana", A2:A21, ">"&(TODAY()-7))
Functions used:
COUNTIFS
Any help you can provide would be appreciated. I can't find any tableau tutorials that deal with conditional formatting based on dates. Plenty of formatting based on cell values, but that doesn't help in this case.
I am trying to create a tableau report that shows the change records that are due within the below criteria and color code the rows accordingly.
The next seven days represented by "red"
The next 14 days represented by "yellow"
Greater than 14 days out represented by "green"
Everything else would have a white background
Something I did that sounds similar was around due dates:
Create a calculated field called "Due Date Traffic Lights" to work out your days amount. The below gives the date difference between the given date field and today:
DATEDIFF('day',MAX([Due Date]), MAX(TODAY()))
Create calculated field "if" function called "Due Date Range" to categrorise these results:
if [Due Date Traffic Lights] < -7 THEN "GREEN: Over One Week Left"
ELSEIF [Due Date Traffic Lights] > -7 AND [Due Date Traffic Lights] <0
THEN "ORANGE: Due in one Week"
ELSE "RED: Overdue"
END
So on your rows you can then drag the "Due Date Range" into your "Color Icon" and set the color for each of the 3.
Here is my issue, I have a table in SSRS that I've created that has a due date field (RegulatoryDateDecisionDue). Based on that date field, I need to change the colors of the rows if today's date is past the due date the field should be red. If the amount of hours are less than or equal to 72 hours from today's date till the due date (basically like a countdown till it's due), the rows should be orange, else rows should be white.
Here is the expression I wrote, but I am having an issue, I get error, and idea what I am doing wrong or if I should be doing this differently? Any and all help appreciated.
=IIF((now() > Fields!RegulatoryDateDecisionDue.Value), "Red", IIF(((DateDiff(DateInterval.Hour, Fields!RegulatoryDateDecisionDue.Value, Now()) <= "72"), "Orange", "White")))
Try:
=Switch(
DateDiff(DateInterval.Hour, Fields!RegulatoryDateDecisionDue.Value, Now())<=72,"Orange",
Fields!RegulatoryDateDecisionDue.Value<now(),"Red",
true,"White"
)
It is better use Switch for multiple conditions.
Let me know if this helps.
Some things to try :
Use a switch instead of iif to have a better reading
use "h" insted of DateInterval.Hour
write 72 instead of "72"
Working with Google Sheets, I'm currently making a year schedule. The sheet should be recycled every year.
Column A has several dates.
D2 is the year, e.g. 2015, 2016 or 2017.
I'm trying to apply conditional formatting to column A. Every month to get its own colour. January coldblue, February blue, March little bit green, et cetera.
The easy way is to use date before .., like 'date before 1-2-2015' for January. But then, the conditional formatting should be altered every year.
How can I use custom formulae (in conditional formatting) using the year from D2 + before start of the next month?
I would not recommend that many different colours (if only because each colour after the first needs a separate rule!) and don't really see the point of D2 for the CF - unless you plan to have a separate set of 12 colours for each year? However, I think what you request is a plethora of formulae like:
=and(year(A1)=D$2,month(A1)=1)
to be repeated with the last 1 changed in integer steps all the way to 12, with a different colour for each such value.