Microsoft Excel

时间:2017-11-13 05:59:23

标签: excel weekday

我有一张excel表,其中Columns的日期为一个月。整个列需要根据标题单元格中的日期是工作日还是周末来着色,我尝试使用工作日公式,但无法完成工作。 有人可以指导我吗?

下面的图片显示了要求。

enter image description here

1 个答案:

答案 0 :(得分:2)

Simply use conditional formatting like this:

enter image description here

Basically, highlight the columns, from the Home tab, select 'Conditional Formatting' > 'New Rule' > 'Use a formula ...', use =WEEKDAY(A$1,2)>5 (A is the cell of the lighter cell from the highlighted range, $1 is the header row, the $ sign ensures that the condition always checks the 1st row), then select the formatting of your choice.

Repeat similar steps for weekdays, except this time the formula will be =WEEKDAY(A$1,2)<6 (or equivalent =WEEKDAY(A$1,2)<=5, etc) and the format will be different.