In this time recording and forecasting sheet, I want to:
Colour code the columns to differentiate between Actual and Forecast
Colour code the columns to differentiate between weekdays and weekends
Conditional Formatting
New Rule...
Use a formula to determine which cells to format
=WEEKDAY(D$3)=1
=AND(OR(WEEKDAY(D$3)=1, WEEKDAY(D$3)=7),D$5="F")
=AND(OR(WEEKDAY(D$3)=1,WEEKDAY(D$3)=7),D$5="F")
=AND(OR(WEEKDAY(D$3)=1,WEEKDAY(D$3)=7),D$5="A")
This doesn't work as you might expect because the value of E3 isn't set (i.e. although D3 and E3 are merged to become one cell, only D3 contains the value we need and E3 equates to 0). We need to find a workaround...
=AND(OR(WEEKDAY(D$16)=1,WEEKDAY(D$16)=7),D$5="F")
=AND(OR(WEEKDAY(D$16)=1,WEEKDAY(D$16)=7),D$5="A")
=AND(OR(WEEKDAY(D$16)=1,WEEKDAY(D$16)=7),D$5="F")
=AND(OR(WEEKDAY(D$16)=1,WEEKDAY(D$16)=7),D$5="A")
=AND(WEEKDAY(D$16)<>1,WEEKDAY(D$16)<>7,D$5="F")
=AND(WEEKDAY(D$16)<>1,WEEKDAY(D$16)<>7,D$5="A")
Using the Custom formula shown to the right, you can conditionally format based on whether a checkbox is checked...
This basically highlights duplicate values in a column.
=ABS($E$5-E9)=MIN(ARRAYFORMULA(ABS($E$5-$E$9:$E$1000)))
=ABS($F$5-F9)=MIN(ARRAYFORMULA(ABS($F$5-$F$9:$F$1000)))
=ABS($G$5-G9)=MIN(ARRAYFORMULA(ABS($G$5-$G$9:$G$1000)))
=ABS($H$5-H9)=MIN(ARRAYFORMULA(ABS($H$5-$H$9:$H$1000)))
When columns are numbered as months, and rows are numbered as years, this formula can be used to highlight the cell corresponfing to the current year and month...
=AND($A2=YEAR(TODAY()),$A2=MONTH(TODAY()))
Cut&Paste tends to corrupt conditional formatting. To allow others to type or paste values in an Excel spreadsheet without allowing them to change formatting...
Select the range of cells where you want users to type or paste values.
Right-click → Format Cells → Protection tab.
Uncheck Locked → Click OK.
Go to Review → Protect Sheet.
In the Protect Sheet dialog:
Enter a password (optional).
Check: Select unlocked cells and Select locked cells (so they can navigate).
Uncheck: Format cells, Format columns, Format rows (this prevents any formatting changes).
Leave other options checked or unchecked as needed.
Click OK.
This is not foolproof. Educate users to use Paste Values (Ctrl-Shift-V) rather than just Paste (Ctrl-V), where possible. Or, be prepared to regularly fix the conditional formatting before it becomes so messed up that it impacts performance of the workbook.
Home - Conditional Formatting - Clear Rules - Clear Rules from Selected Cells
Home - Conditional Formatting - Clear Rules - Clear Rules from Entire Sheet
Developer - Visual Basic -- Insert - Module...
Sub DeleteConditionalFormats()
Dim WorkRng As Range
On Error Resume Next
xTitleId = "ClearConditional"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
WorkRng.FormatConditions.Delete
End Sub
F5 to run. Enter a range in prompt box