How to highlight dates based on day of week
The following conditional formatting formula highlights dates based on day of the week.
The TEXT function converts a value to text based on formatting code. The second argument "DDDD" converts the date to day of week.
TEXT(B3,"DDDD")
becomes
TEXT(43101,"DDDD")
and returns Monday.
The equal sign checks if the value is equal to cell $D$3. The dollar signs make sure that cell reference $D$3 doesn't change. Each cell in range B3:B14 is evaluated and if they are equal the logical expression returns a boolean value: TRUE or FALSE.
TEXT(B3,"DDDD")=$D$3
becomes
"Monday"="Monday" and returns TRUE. This highlights cell B3.
How to apply conditional formatting to a cell range
- Select cell range.
- Go to tab "Home"
- Press with left mouse button on "Conditional Formatting" button.
- Press with left mouse button on "New Rule..."
- Select "Use a formula to determine which cells to format"
- Type the formula in field "Format values where this formula is true:"
- Press with left mouse button on "Format" button, then pick a formatting.
- Press with left mouse button on OK button.
- Press with left mouse button on OK button.
Highlight records based on day of week
Column B contains all the dates we want to be evaluated, we need to make sure that the conditional formatting formula is locked to column B. A dollar sign in front of column B is what we need.
Cell range B3:B14 has conditional formatting applied, the formula checks if the date is today. Conditional formatting formula: =TODAY()=B3 A […]
This article demonstrates event code combined with Conditional Formatting that highlights overlapping date ranges based on the selected date range. […]
Question: How do I highlight dates that meet criteria using conditional formatting? Table of contents Highlight values in a column […]
Color odd months Conditional formatting formula: =MOD(MONTH($B6),2) Explaining CF formula in cell B6 Step 1 - Calculate number of month The […]
The image above demonstrates a conditional formatting formula that colors a record if there is at least one record that […]
adam asks: Hi, I have a situation where I want to count if this value is duplicate and if it […]
The image above shows rows highlighted based on value in column C being the largest or smallest in that particular […]
The image above shows conditional formatting applied to cell range C8:C20, it highlights cells containing dates that fall on Saturdays […]
One Response to “How to highlight dates based on day of week”
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
I have sheets that I scan data to from bar codes. I want to highlight the data by the day of the week it was scanned in. If it is Monday I want the cells to be one color, then the next day I want them to scan a different color. Once color for each day Mon-Sat
I know I can make cells highlight based on the weekday if the cell contains a date but that is not what I am trying to do. These cells will be blank until data is scanned into them. At that point I would like the highlight to change to a different color depending on the current weekday.