用正则校验
\\d{4}-\d{\1-\12}-\d{\1-\31}?
或者公式校验
https://help.fanruan.com/finereport/doc-view-567.html
假设单元格是A1
FORMAT(TODATE(A1,'yyyy-MM-dd'),'yyyy-MM-dd')=A1
--
REGEXP(A2, "^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$")