简体   繁体   English

如果单元格值大于日期

[英]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. 我有一个日期存储在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. 逻辑(H2 =“ A”,AN3 =“ CTO”,BB3 <>“ 8”和BI3> 10/01/2017)应产生错误。 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? 另外,BB3是数字吗? If it is not stored as a string, you might want to remove the quotes around 8 as it forces an implicit conversion. 如果未将其存储为字符串,则可能要删除8左右的引号,因为它会强制进行隐式转换。

I ended up using this: 我最终使用了这个:

BI2>43009

And it works. 而且有效。 Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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