简体   繁体   中英

compare date in cell with today() for conditional formatting

I am trying to create conditional formatting where I compare dates in the cells of a column with today(). However, when I check with evaluate formula, today() gives a short date ( 44231 ) and my cells are formatted as 24/08/2021 The result of =B2<today() thus results in false even though it is true. How can I solve this?

在此处输入图像描述

在此处输入图像描述

You need to convert your string into a date value, which can be done using the DATEVALUE() function, explained here . Be very careful working with that function, because it's related to your regional settings: does "01/02/2021" mean the first of February or the second of January?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM