基于日期条件的条件格式(Conditional Formatting)设置:添加日期等于今日的判定条件语法问题求助
Fixing Your Conditional Formatting Formula
Got it, let's tweak your existing formula to add the "date equals today" condition you need.
First, let's recap what your original formula does: it highlights cells where:
- Column K contains the text "Condo"
- AND either:
- It's Wednesday to Saturday, and the date in column X is yesterday
- OR it's Tuesday, and the date in column X is between 3 days ago and yesterday
To add the "date equals today" check, we just need to insert that condition as an additional option in the outer OR() statement. Here's the updated formula:
=AND(ISNUMBER(SEARCH("Condo",K11)),OR( AND(WEEKDAY(TODAY())>=3,WEEKDAY(TODAY())<=6,INT(X11)=INT(TODAY()-1)), AND(WEEKDAY(TODAY())=2,INT(X11)>=INT(TODAY()-3),INT(X11)<=INT(TODAY()-1)), INT(X11)=INT(TODAY()) ))
Breakdown of the change:
- We added a third line inside the
OR():INT(X11)=INT(TODAY()) - Using
INT()here ensures we ignore any time values attached to the dates (so even if X11 has a timestamp like2024-05-20 14:30, it will still match today's date2024-05-20)
How to apply this:
- Open your conditional formatting rule manager
- Select the existing rule you're using
- Replace the formula with the one above
- Double-check your formatting style (fill color, etc.) is still set correctly
- Click OK to save the changes
That should do it! Now any row where K11 has "Condo" AND either meets your original date criteria OR the date in X11 is today will get highlighted.
内容的提问来源于stack exchange,提问作者MEC
相关产品推荐
相关产品推荐

