开发者

Convert string/numeric date in Excel to a date formatted object using only formulas

开发者 https://www.devze.com 2023-02-09 18:41 出处:网络
Folks, I have a string date which I can convert to numeric using: =DateValue(\"1/2/2011\") results in 39084

Folks,

I have a string date which I can convert to numeric using: =DateValue("1/2/2011") results in 39084

I'm trying to use ONLY FORMULAS to convert either the string or the numeric date into a date formatted object. Using the UI for formattin开发者_StackOverflow中文版g is not an option.


Use TEXT()

example:

=Text(DateValue("1/2/2011"), "yyyy/mm/dd")


This works:

A1 = Text("1/2/2011", "mm/dd/yyyy")
=DATE(VALUE(MID(A1,7,4)), VALUE(MID(A1,1,2)), VALUE(A1(B10, 4, 2)))
0

精彩评论

暂无评论...
验证码 换一张
取 消