Convert text (12.05.79) to date in excel

最后都变了- 提交于 2019-12-25 07:39:16

问题


I have imported some dates into an excel document and I need to format them as dates not text strings.

The format is like this: 12.05.79 but when I set the format to date excel doesn't do anything.

Any way to do this?

C


回答1:


Two possible ways to convert "in situ" without an extra column

1 - use "Text to columns"

Select column of dates then Data > text to columns > Next > Next > "under column data format" select "Date" and the format from dropdown (MDY or DMY) > OK

2 - use Edit/Replace. Replace "." with "/" (in both cases without quotes)




回答2:


Changing the format doesn't change the value (or in this case text). You'll have to use a macro, or just use a helper column with the following formula. You can then copy / paste values and remove the first column

=DATEVALUE(SUBSTITUTE(A1,".","/"))


来源:https://stackoverflow.com/questions/13373272/convert-text-12-05-79-to-date-in-excel

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