Google Sheets条件格式需求:今日在活动日期范围时高亮日期单元格
How to Highlight Event Date Range in Google Sheets When Today Falls Within It
Got it, let’s get this sorted for you! The key here is using a custom formula rule in Google Sheets’ conditional formatting—this lets you check if today sits between your start and end dates, and keeps both cells highlighted as long as that’s true, even as dates update automatically.
Step 1: Select Your Target Cells
- For a single event (row 2), click and drag to select cells
A2andB2. - If you have multiple events in rows below (like A3:B3, A4:B4), select the entire columns
A:Binstead—this will apply the rule to every row automatically.
Step 2: Open Conditional Formatting
- Click the Format menu at the top of Google Sheets.
- Choose Conditional formatting from the dropdown. The conditional formatting sidebar will pop up on the right.
Step 3: Set Up the Custom Formula Rule
In the sidebar:
- Under "Format cells if", click the default dropdown (usually "Is equal to") and scroll to select Custom formula is.
- Paste this formula into the input box:
Let’s break this down simply:=AND(TODAY()>=A2, TODAY()<=B2)TODAY()pulls the current date automatically—no manual updates needed.TODAY()>=A2checks if today is on or after the event start date in A2.TODAY()<=B2checks if today is on or before the event end date in B2.AND()ensures both conditions are true—so the highlight only shows when today is between the start and end dates (inclusive).
Step 4: Pick Your Highlight Style
Under "Formatting style", choose a fill color, text color, or other formatting to make the cells stand out. A soft yellow fill is a great go-to for gentle visibility.
Step 5: Save the Rule
Click Done in the sidebar, and you’re all set!
How It Behaves Over Time
- As long as today is within the event’s date range, A2 and B2 (or the corresponding row’s cells) will stay highlighted.
- Once today passes the end date, the
TODAY()<=B2condition will fail, and the highlight will disappear on its own—no need to manually turn it off!
内容的提问来源于stack exchange,提问作者Marcos Medina
相关产品推荐
相关产品推荐

