What am I doing wrong ? Desired Output: Column InRange should contain YES for two last rows. Answer Try specifying ISO format dates, more than likely your regional settings are having an effect. If you use YYYYMMDD there is no ambiguity. The following works fine: