TEXT函数在两个不同的电子表格中返回不同的值
我对以下内容感到困惑:
- 在电子表格A上,
=TEXT(41432, "mm/dd/yyyy")
返回06/07/2013 - 在电子表格B上,
=TEXT(41432, "mm/dd/yyyy")
返回06/08/2017
全部在同一台计算机上! 这是怎么回事? 谢谢!
检查文件上的选项:文件\选项\高级\向下滚动到计算此工作簿时,您会看到其中一个工作簿已激活使用1904年date系统。
1904在Mac上默认使用,而不是在PC上
看看这个微软的kb文章更多的细节。
要更新文件中的date,可以使用这个macros。 这将比手动更新更快。
Sub UpdateDates() Dim sht As Worksheet, rg As range 'turn off updates to speed up code execution With application .ScreenUpdating = False .EnableEvents = False .Calculation = xlCalculationManual End With For Each sht In ActiveWorkbook.Worksheets For Each rg In sht.UsedRange.SpecialCells(xlCellTypeConstants, xlNumber).Cells If IsDate(rg) Then rg = rg - 1462 'adjust + / - 1462 depending on your needs Next rg Next sht With application .ScreenUpdating = True .EnableEvents = True .Calculation = xlCalculationAutomatic End With End Sub