首页 > 解决方案 > Using TODAY() in YYYY-MM-DD format with Conditional Formatting in Excel

问题描述

In Excel, is there a way to format TODAY() into the YYYY-MM-DD format? I've setup Conditional Formatting so that if a cell =TODAY(), the entire row becomes bold. However, it only works when the dates are in standard MM-DD-YYYY format. Any suggestions?

Current Conditional Formatting formula looks like this:

=$B1=TODAY()

The date cells, which come from an external database are stored as YYYY-MM-DD in column 'B'.

Thank you in advance!

标签: excelexcel-formulaconditional-formatting

解决方案


Then one of two things. Your date is text and not a true date, or there is a time component to your date that the format is hiding.

For the prior, text instead of date, use:

=$B1=TEXT(TODAY(),"YYYY-MM-DD")

But the better solution is to change the text to a date or remove the time part. Either will be done with this formula:

=INT(--$B1) = TODAY()

推荐阅读