在 Excel 中,我试图让一个单元格看起来像:
by no later than August 27, 2012
当我尝试将字符串与 a 连接时DATE
,例如:
="by no later than " & DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))
我得到这样的输出:
by no later than 41118
如何获得显示日期而不是整数?
在 Excel 中,我试图让一个单元格看起来像:
by no later than August 27, 2012
当我尝试将字符串与 a 连接时DATE
,例如:
="by no later than " & DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY()))
我得到这样的输出:
by no later than 41118
如何获得显示日期而不是整数?
DATE
构建日期时间戳。您需要将其转换为字符串。请参阅此问题以了解如何执行此操作:
它看起来像这样:
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())), "DD/MM/YYYY hh:mm:ss")
对于今天的日期,您根本不需要 DATE 函数,您可以只使用
="by no later than "&TEXT(TODAY(),"mmmm d, yyyy")
如果您将包含您的数字的单元格格式化(41118)
为Date
,您将得到准确的 27.8.2012。简单的!