Forum Discussion
JoeJP
Oct 06, 2022Copper Contributor
What is wrong with this equation. I get Error code 504.
W231 =Datevalue('11/1/22) W218=Datevalue('10/1/21) W219=Datevalue('11/1/21) W220=Datevalue('2/1/21) Err:504 ◄'=IF((W231-W218)>=30=1,66.42,IF(W231-W219)>=60=1,132.84,IF(W231-W220)>=9...
JoeUser2004
Oct 06, 2022Bronze Contributor
JoeJP wrote: ``What is wrong with this equation``
To answer your question, the syntax '11/1/22 (leading apostrophe) is valid only as a constant entered by itself into a cell. As the first character, the apostrophe (single-quote) tells Excel not to interpret the characters to the right.
Ostensibly, you might enter "11/1/22" (matching double-quotes). However, I assume you are entering dates in the form DMY. That might not work if the workbook is opened on a computer that uses MDY dates, for example.
DATE(2022,11,1) is more reliable (portable) than DATEVALUE("11/1/22").