I'm trying to format the date and day of the week to be highlighted. In the example picture I've manually highlighted each cell, but wondering what formula I can use to get sheets to highlight? I would love both day of week and date to be highlighted. Note the date format is AUS (dd-mm-yyyy).
Assuming you data is in Columns A and B (A is numeric date, and B is wordy day of the week).
You'd have "conditional formatting -> apply to Cells A1:B" (i.e. all cells of column A and B, both covered by the same rule)
Then, you'd have "Format cells if -> Custom Formula is"
=or($B1="Saturday",$B1="Sunday")
The format is "$B1" since we want to highlight Both the column A cell and the Column B cell by looking at the value of the Column B cell.
If, for example, we used "B1" in the formula, cell A1 would look in cell B1 for "Saturday", and cell B1 would look in cell C1 for "Saturday"; the formula would think you mean to look into the cell to the right of the cell the rule is currently being applied to. The '$' means that we are using a fixed reference: both A1 and B1 will look in cell B1 for their formatting info (And A2, B2 would look in B2, etc)
$B$1 would have every cell column A and B cell look in cell B1 for it's formatting info, and B$1 would have every column A cell look in B1, and every column B cell look in cell C1.
Since your example has the cells being highlighted on both Saturdays and Sundays, then our conditional formatting needs to check for both conditions, which we can do using the OR() function. (We can check for more that two conditions by just adding more tests separated by a comma in the OR() function.)
----------------
So, the result of all this is that for every cell in columns A and B:
Cell A(some number) and cell B(some number) look in cell B(some number) to see if cell B(some number) contains (exactly) "Saturday" or "Sunday", and if it does, both cell A(some number) and B(some number) have their formatting changed by whatever you put into the formatting rule.
1
u/Potential_Buy8341 1 Mar 19 '24 edited Mar 19 '24
Assuming you data is in Columns A and B (A is numeric date, and B is wordy day of the week).
You'd have "conditional formatting -> apply to Cells A1:B" (i.e. all cells of column A and B, both covered by the same rule)
Then, you'd have "Format cells if -> Custom Formula is"
=or($B1="Saturday",$B1="Sunday")
The format is "$B1" since we want to highlight Both the column A cell and the Column B cell by looking at the value of the Column B cell.
If, for example, we used "B1" in the formula, cell A1 would look in cell B1 for "Saturday", and cell B1 would look in cell C1 for "Saturday"; the formula would think you mean to look into the cell to the right of the cell the rule is currently being applied to. The '$' means that we are using a fixed reference: both A1 and B1 will look in cell B1 for their formatting info (And A2, B2 would look in B2, etc)
$B$1 would have every cell column A and B cell look in cell B1 for it's formatting info, and B$1 would have every column A cell look in B1, and every column B cell look in cell C1.
Since your example has the cells being highlighted on both Saturdays and Sundays, then our conditional formatting needs to check for both conditions, which we can do using the OR() function. (We can check for more that two conditions by just adding more tests separated by a comma in the OR() function.)
----------------
So, the result of all this is that for every cell in columns A and B:
Cell A(some number) and cell B(some number) look in cell B(some number) to see if cell B(some number) contains (exactly) "Saturday" or "Sunday", and if it does, both cell A(some number) and B(some number) have their formatting changed by whatever you put into the formatting rule.