在excel中,日期显示为mdyyyy,想要像mm-dd-yyyy [英] In excel, date shows as mdyyyy, want as mm-dd-yyyy

查看:220
本文介绍了在excel中,日期显示为mdyyyy,想要像mm-dd-yyyy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个excel文件有一个日期字段,但发生的是电子表格中的日期显示为mdyyyy(例如5271960将是05-27-1960)。我们怀疑你的日期字段不包含一个真实的日期,但只是这个真实的日期。你显示的数字字符串如果它包含一个真实的日期,那么你可以只是自定义格式,但是你希望。



如果它包含值5271960或类似的,那么首先将其转换为一个真实的日期使用这个公式(假设你的伪节点在A1):

  = DATE(MOD(A1,10 ^ 4) ,INT(A1 / 10 ^ 6),MOD(INT(A1 / 10 ^ 4),100))

然后自定义格式化单元格以显示日期。



另一个选项,如果您只是在使用Excel的机器上处理Excel Windows区域设置中的美国格式:MDY

  =  -  TEXT(A1,00\ / 00\ / 0000 )

这将将值转换为实际日期,然后您可以自定义格式希望。


Hello I have an excel file that has a date field but what is happening is the date in the spreadsheet shows as mdyyyy (example 5271960 would be 05-27-1960). How does one convert the field in excel?

解决方案

I suspect your date field is not containing a "real" date but just the string of numbers you show. If it does contain a "real" date, then you can merely custom format it however you wish.

If it contains the value 5271960 or similar, then first convert it to a real date using this formula (assuming your pseudodate is in A1):

=DATE(MOD(A1,10^4),INT(A1/10^6),MOD(INT(A1/10^4),100))

Then custom format the cell to show the date as you prefer.

Another option, if you are only going to be dealing with Excel on machines that are using the US format in the Windows Regional Settings: MDY

=--TEXT(A1,"00\/00\/0000")

This will convert the value to a "real date" and you can then custom format as you wish.

这篇关于在excel中,日期显示为mdyyyy,想要像mm-dd-yyyy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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