简体   繁体   中英

IF Cell Value Greater Than Date

I'm trying to flag certain conditions as an error when performing some data audits. But unfortunately my date criteria seems to not be working. I have a date stored in column BI. I have tried the following formula:

=IF(AND(H3="A",AN3="CTO",BB3<>"8",BI3>="10/1/2017"),"Error","Good")

The logic (H2 = "A", AN3 = "CTO", BB3 <> "8", and BI3 > 10/01/2017) should produce an error. But it does not and I suspect it's the date portion of the formula. I have also tried:

=IF(AND(H3="A",AN3="CTO",BB3<>"8",BI3>=DATE(2017,10,1)),"Error","Good")

But that did not work either. Any help would be greatly appreciated. Thanks in advance!

You are comparing a date to a string. Different datatypes. Try this:

=IF(AND(H3="A",AN3="CTO",BB3<>"8",BI3>=DATEVALUE("10/1/2017")),"Error","Good")

Also, is BB3 a number? If it is not stored as a string, you might want to remove the quotes around 8 as it forces an implicit conversion.

I ended up using this:

BI2>43009

And it works. Thanks!

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