简体   繁体   English

Excel公式的日期,但不包括空单元格

[英]Excel Formula for Dates, But Excluding Empty Cells

I didn't find anything that quite fits my task. 我没有找到任何适合我任务的东西。 I'd like to identify cells in an Excel spreadsheet that contain dates before a specified date, but exclude the cells with spaces. 我想在Excel电子表格中标识包含指定日期之前的日期的单元格,但要排除带有空格的单元格。 Here's my current formula: 这是我目前的公式:

=IF(A2<=DATE(2019,2,8),"YES","")

Which produces: 产生:

电子表格的屏幕截图

However, I also want to exclude the cells with spaces. 但是,我也想排除带有空格的单元格。 I tried: 我试过了:

=IF(and((isnumber(a2)),(A2<=DATE(2019,2,8))),”YES","")

But that didn't work. 但这没有用。 I'm close, but missing a piece of the puzzle. 我很亲密,但缺少一个难题。

in your formula 在你的公式中

=IF(and((isnumber(a2)),(A2<=DATE(2019,2,8))),”YES","")

you are closing the AND() brackets too early. 您过早关闭AND()括号。 (you also have fancy quotes in front of the Yes). (您也可以在“是”前面加上引号)。 Don't go overboard with brackets. 不要过度使用括号。 It makes it harder to keep track of what's what. 这使得更难跟踪什么是什么。 This one should work: 这应该工作:

=IF(and(isnumber(a2),A2<=DATE(2019,2,8)),"YES","")

在此处输入图片说明

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

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