将字符串转换为单元格中的日期 [英] Converting a string to a date in a cell

查看:116
本文介绍了将字符串转换为单元格中的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel中有100.000行数据。某些字段是日期,但Excel中的字段是文本。我需要数字格式的这些字段,包括日期和时间(例如21.10.2011 13:10:50)。格式化单元格不起作用,因为这不会更改数据类型。我可以用公式选择日期和时间,但不能将它们放在同一个单元格中。



所以我正在寻找的是计算一个日期(如果您将日期格式化为数字,则会看到)。

解决方案

你尝试过 = DateValue() function? p>

要包含时间值,只需将功能添加在一起:



= DateValue(A1) + TimeValue(A1)


I have 100.000 rows of data in Excel. Some of the fields are dates, but the fields in Excel are as text. I need these fields in number format including both dates AND time (e.g. 21.10.2011 13:10:50). Formatting the cells doesn't work because that doesn't change the datatype. I can pick out the date and time with formulas but not get them in the same cell.

So what I am looking for is the formula to calculate the number representation of a date (the one you see if you format a date as a number).

解决方案

Have you tried the =DateValue() function?

To include time value, just add the functions together:

=DateValue(A1)+TimeValue(A1)

这篇关于将字符串转换为单元格中的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆