Note: The other languages of the website are Google-translated. Back to English
登陆  \/ 
x
or
x
注册  \/ 
x

or

如何在Excel中条件格式日期小于/大于今天?

您可以在Excel中根据当前日期有条件地格式化日期。 例如,您可以格式化今天之前的日期,或者格式化大于今天的日期。 在本教程中,我们将向您展示如何在条件格式中使用TODAY函数来详细显示Excel中的到期日期或将来的日期。

条件格式日期在Excel之前的今天或将来的日期


条件格式日期在Excel之前的今天或将来的日期

假设您有一个日期列表,如下图所示。 为了让到期日和将来的日期尚未到期,请执行以下操作。

1.选择范围A2:A15,然后单击 条件格式 > 管理规则首页 标签。 看截图:

2。 在里面 条件格式规则管理器 对话框中,单击 新规则 按钮。

3。 在里面 新格式规则 对话框,您需要:

1)。 选择 使用公式来确定要在“选择规则类型”中格式化的单元格 部分;

2)。 对于 格式化比今天早的日期,请复制并粘贴公式 = $ A2格式化此公式为真的值 框;

格式化未来日期,请使用此公式 = $ A2>今天();

3)。 点击 格式 按钮。 看截图:

4。 在里面 单元格格式 对话框中,指定到期日期或将来日期的格式,然后单击 OK 按钮。

5.然后返回到 条件格式规则管理器 对话框。 并创建了到期日期格式规则。 如果您想立即应用规则,请点击 申请 按钮。

6.但是,如果要同时应用到期日期规则和将来日期规则,请通过重复上述步骤2至4,使用将来日期格式公式创建新规则。

7.返回到 条件格式规则管理器 再次出现对话框,您会看到框中显示了两个规则,请单击 OK 按钮开始格式化。

然后,您可以看到成功格式化了比今天早的日期和比今天大的日期。

轻松地在选择中每隔n行使用条件格式:

Kutools for Excel's 交替的行/列底纹 实用程序可帮助您轻松地将条件格式添加到Excel选择中的每n行。
立即下载Kutools for Excel的全功能30天免费试用版!


相关文章:


最佳办公效率工具

Kutools for Excel解决了您的大多数问题,并使您的生产率提高了80%

  • 重用: 快速插入 复杂的公式,图表 以及您以前使用过的任何东西; 加密单元 带密码 创建邮件列表 并发送电子邮件...
  • 超级公式栏 (轻松编辑多行文本和公式); 阅读版式 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不会丢失数据; 拆分单元格内容; 合并重复的行/列...防止细胞重复; 比较范围...
  • 选择重复或唯一 行; 选择空白行 (所有单元格都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择...
  • 确切的副本 多个单元格,无需更改公式参考; 自动创建参考 到多张纸; 插入项目符号,复选框等...
  • 提取文字,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级滤镜 (将过滤方案保存并应用于其他工作表); 高级排序 按月/周/日,频率及更多; 特殊过滤器 用粗体,斜体...
  • 结合工作簿和工作表; 根据关键列合并表; 将数据分割成多个工作表; 批量转换xls,xlsx和PDF...
  • 超过300种强大功能。 支持Office / Excel 2007-2019和365。支持所有语言。 在您的企业或组织中轻松部署。 完整功能30天免费试用。 60天退款保证。
kte选项卡201905

Office选项卡为Office带来了选项卡式界面,使您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
officetab底部
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Scooter73 · 1 years ago
    I am trying to create conditional formatting that will highlight rows older than 14 days in yellow and highlight rows older than 21 days in red. My date column starts in A2, I have the following rules applied, but only yellow is highlighting and just the date column, not the entire row. Can you help? Scott

    1. =ISBLANK(A2)=TRUE
    2. =A2<TODAY()-14
    3. =A2<TODAY()-21

  • To post as a guest, your comment is unpublished.
    Madhu · 1 years ago
    I want to ignore blank cells which doesn't have a date i.e I do not want blank cells to be highlighted when I am comparing dates<Today(). Please help
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi Madhu,
      The first method in this artice can help you solve the problem. Please have a try.
      https://www.extendoffice.com/documents/excel/2499-excel-conditional-formatting-ignore-blank-zero.html
  • To post as a guest, your comment is unpublished.
    grant · 2 years ago
    1 colum has the dates in it i want another colum to change colour when this formula is applied.

    any ideas?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi grant,
      Supposing you want to change the cell color in column B based on dates in column A, please select the column B cells (such as B2:B21), and apply the conditional formatting function with the above formulas =$A2>Today() or =$A2<Today().
  • To post as a guest, your comment is unpublished.
    SG · 2 years ago
    Hello! can anyone help me?

    I have =TODAY() formula in A1 and need 3 more rules to work as per below

    rule 1 all dates 8 to 14 days older than today

    rule 2 : all dates older 14 to 30 days than today

    rule 3: all dates 31 or more days older than today
    • To post as a guest, your comment is unpublished.
      Lukas · 2 years ago
      it should be something like this:

      if(*cell*+8>Today();if(*cell*+14<Today();"8-14 from today";"N/A"))
  • To post as a guest, your comment is unpublished.
    Jason · 3 years ago
    Does it consider the year?
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Hi,
      It takes the year into consideration.
  • To post as a guest, your comment is unpublished.
    Jason · 3 years ago
    This does not work for me. Today is 4/12/18. I want it to highlight dates older than today so I copied the formula =$A2<TODAY() and changed the A to an E since it's column E for me. It's highlighting dates of 5/1/21, etc.
  • To post as a guest, your comment is unpublished.
    Cody · 3 years ago
    This also highlights any cells that do not have a date in them, how can they be ommitted?
    • To post as a guest, your comment is unpublished.
      Warren · 3 years ago
      I have this question es well, do you receive a response?
      I tried to add in a isblank function into the formula but no luck
      • To post as a guest, your comment is unpublished.
        crystal · 3 years ago
        Dear Cody and Warren,
        Please change the formula to =AND(CELL("FORMAT",A2)="D4",A2 in your conditional formatting rule. Thank you for your comment.
        • To post as a guest, your comment is unpublished.
          NateZMa · 3 years ago
          This did not work for me. Can you tell me what the variables of this formula are? I have 3 columns I am looking to do this for... do I need to do it separately for each or can I select all the cells in all 3 columns into one formatting? Do I need a cell for TODAY to base the formula off of? Sorry... self taught excel user=asks questions that others might consider simple.
  • To post as a guest, your comment is unpublished.
    Kim Fabian · 5 years ago
    Thank you for your article. I want to hi light a cell when the date is 60 days in the future. Can you help me write the correct formula to achieve this please.
    • To post as a guest, your comment is unpublished.
      Gabar · 2 years ago
      =AND($D2-$C2>=0,$D2-$C2>=60)

      C2-Start Date
      D2- End Date