简体   繁体   中英

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. 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. (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","")

在此处输入图片说明

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