Comparing computed dates with entered dates

两盒软妹~` 提交于 2019-12-31 06:22:33

问题


I have in cell p4 the date: 2014-01-01 (obtained via formula (=(((O5/1000/60)/60)/24)+DATE(1970,1,1)))

I have in cell b5 the date: 2014-01-01 (typed in)

=(p4=b5) gives false

=(p4>=b5) gives false

How do I compare dates correctly in Excel?


回答1:


You should be safe with chopping the parts up and reassembling them:

=DATE(YEAR(P4),MONTH(P4),DAY(P4))=DATE(YEAR(B5),MONTH(B5),DAY(B5))



回答2:


  • Select the two date cells.
  • Press CTRL+1 to show the format tab
  • On the Number tab, in the Format list, click Text

Perhaps there is a more appropriate comparison format, when you have dates in the format YYYY-MM-DD I think this one will work).



来源:https://stackoverflow.com/questions/21943600/comparing-computed-dates-with-entered-dates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!