gpt4 book ai didi

Excel 文件混合了日期作为文本和序列号

转载 作者:行者123 更新时间:2023-12-04 21:55:29 25 4
gpt4 key购买 nike

我得到了一个 Excel 文件,其中的一些日期实际上是 serial dates (42741、42800 等),有些只是文本。由于序列日期被格式化为日期,它们看起来都很相似,但 Excel 无法正确对它们进行排序,并将它们显示为跨越一年而不是它们实际代表的两个月期间。
更糟糕的是,日期格式为美式格式(mm/dd/yyyy),而我的系统使用国际格式(dd/mm/yyyy)。
我该如何清理这些数据!?

最佳答案

假设您的日期在 A 列中,将以下内容放在相邻列中并相应地复制下来。

=IF(ISNUMBER(A2),L7,DATE(RIGHT(A2,4),LEFT(A2,2),MID(A2,FIND("/",A2)+1,2)))

替代使用 TEXT to Column 功能区中的内置功能。
1)  Select your range of mixed dates
2) Select Text-to-Columns
3) Keep selecting next until you come to the page after selecting delimiters
4) Choose your destination location (default is overnighting your data)
5) Select the column header in the preview
6) Select the Date radio button for format
7) Select the date format that matches the source format

序列日期将保持不变,并且将转换文本日期。

关于Excel 文件混合了日期作为文本和序列号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45695628/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com