Likely formatting issue when comparing dates using If statement

%3CLINGO-SUB%20id%3D%22lingo-sub-2245575%22%20slang%3D%22en-US%22%3ELikely%20formatting%20issue%20when%20comparing%20dates%20using%20If%20statement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2245575%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Heritage_CCS_0-1617142212100.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F268379i95093852A26E86A2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Heritage_CCS_0-1617142212100.png%22%20alt%3D%22Heritage_CCS_0-1617142212100.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EColumn%20S%20is%20a%20copy%20from%20another%20tab%20(%20%3D'other%20tab'!s3)%3C%2FP%3E%3CP%3EAs%20you%20can%20see%2C%20the%20result%20of%20the%20if%20statement%20is%20incorrect....%20UNLESS%20I%20manually%20enter%20the%20date%20in%20column%20S.%20I%20suspect%20some%20type%20of%20formatting%20issue%20but%20am%20at%20a%20loss%20for%20what%20to%20try.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2245575%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

Heritage_CCS_0-1617142212100.png

 

Column S is a copy from another tab ( ='other tab'!s3)

As you can see, the result of the if statement is incorrect.... UNLESS I manually enter the date in column S. I suspect some type of formatting issue but am at a loss for what to try. 

2 Replies

@Heritage_CCS 

The values in column B are right-aligned, suggesting that they are "real" dates.

The values in column S are left-aligned, suggesting that they are text values that look like dates.

Try this:

 

=IF(B3<>IFERROR(DATEVALUE(S3),0),"OFF","")

@Hans Vogelaar THANK YOU so much...that resolved the issue.