You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Excel=TODAY()函数结合缺勤数据设置在岗状态可视化标识

Absolutely! You can totally use Excel's TODAY() function paired with conditional formatting to build this dynamic attendance status marker—let's walk through exactly how to do it with your existing data setup:

Step 1: Core Logic Breakdown

First, we need a way to check if today's date falls within any of an employee's recorded absence windows. The formula below compares TODAY() to the start and end dates of each absence entry:

=AND(TODAY()>=B2, TODAY()<=C2)

(Replace B2 with your "Absence Start Date" cell, and C2 with your "Absence End Date" cell. This returns TRUE if the employee is absent today, FALSE if they're on duty.)

Step 2: Option 1 - Color-Code Cells (Quick Visual Scan)

Perfect for at-a-glance status checks:

  • Select the column (or cells) where you want the status marker to appear (e.g., a new column next to employee names)
  • Go to the Home tab → click Conditional Formatting → New Rule
  • Choose "Use a formula to determine which cells to format"
  • Paste the formula above, then click Format to pick a fill color (like red for absent)
  • Repeat the process to create a second rule for on-duty status: use =NOT(AND(TODAY()>=B2, TODAY()<=C2)) and set a green fill color

Step 3: Option 2 - Use Icon Sets (More Intuitive Visuals)

If you prefer icons over colors (like checkmarks for on-duty, X's for absent):

  • Select your target column, open Conditional Formatting → New Rule
  • Choose "Format all cells based on their values"
  • Under Format Style, pick Icon Sets and select a set like "Checkmark/ X"
  • Click Reverse Icon Order so the X shows for absent status
  • Switch the Type dropdown from "Number" to "Formula" for each icon:
    • For the X icon: Use =AND(TODAY()>=B2, TODAY()<=C2)
    • For the checkmark icon: Use =NOT(AND(TODAY()>=B2, TODAY()<=C2))
  • Hit OK, and your icons will update automatically every day!

Quick Pro Tips

  • Double-check that your absence start/end dates are formatted as Excel dates (not plain text) — otherwise the TODAY() comparison won't work
  • Since TODAY() is a dynamic function, the status will refresh automatically every time you open the workbook
  • If an employee has multiple absence records, wrap the AND() checks in an OR() function to cover all their windows (e.g., =OR(AND(TODAY()>=B2,TODAY()<=C2), AND(TODAY()>=B3,TODAY()<=C3)) for two entries)

内容的提问来源于stack exchange,提问作者Kevin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:40:59