excel更改日期格式无效

Have you ever imported data into Excel, from your credit card statement, or somewhere else, and found that Excel dates won't change format? And, if you try to sort that column of dates, things end up in the wrong order.

您是否曾经从信用卡对帐单或其他地方将数据导入Excel,发现Excel日期不会更改格式? 而且,如果您尝试对那列日期进行排序,那么事情将以错误的顺序结束。

That happened to me this week, and here’s how I fixed the problem, using a built-in Excel tool.

这周发生在我身上,这就是我使用内置的Excel工具解决问题的方式。

日期为文字 (Dates As Text)

In the screen shot below, you can see the column of imported dates, which show the date and time. I didn’t want the times showing, but when I tried to format the column as Short Date, nothing happened – the dates stayed the same.

在下面的屏幕快照中,您可以看到导入日期的列,其中显示了日期和时间。 我不希望显示时间,但是当我尝试将列格式设置为“短日期”时,什么也没发生–日期保持不变。

Why won’t the dates change format? Even though they look like dates, Excel sees them as text, and Excel can’t apply number formatting to text.

为什么日期不更改格式? 即使它们看起来像日期,Excel也会将它们视为文本,并且Excel无法将数字格式应用于文本。

There are a few signs that the cell contents are being treated as text:

有一些迹象表明单元格内容被视为文本:

  • The dates are left-aligned日期左对齐
  • There is an apostrophe at the start of the date (visible in the formula bar)日期开头有撇号(在编辑栏中可见)
  • If two or more dates are selected, the Quick Calc in the Status Bar only shows Count, not Numerical Count or Sum.如果选择了两个或多个日期,则状态栏中的“快速计算”仅显示计数,而不显示数值计数或总和。

确定日期 (Fix the Dates)

If you want to sort the dates, or change their format, you’ll have to convert them to numbers – that’s how Excel stores valid dates. Sometimes, you can fix the dates by copying a blank cell, then selecting the date cells, and using Paste Special > Add to change them to real dates.

如果要对日期进行排序或更改其格式,则必须将其转换为数字,这就是Excel存储有效日期的方式。 有时,您可以通过以下方式修复日期:复制空白单元格,然后选择日期单元格,然后使用“选择性粘贴”>“添加”将其更改为实际日期。

Unfortunately, that technique didn’t work on this data, probably because of the extra spaces. You could go to each cell, and remove the apostrophe, but that could take quite a while, if you have more than a few dates to fix.

不幸的是,可能由于多余的空间,该技术无法在此数据上使用。 您可以转到每个单元格并删除撇号,但是,如果要修复的日期不止几个,则可能要花费相当长的时间。

A much quicker way is to use the Text to Columns feature, and let Excel do the work for you:

一种更快的方法是使用“文本到列”功能,然后让Excel为您完成工作:

  • Select the cells that contain the dates选择包含日期的单元格
  • On the Excel Ribbon, click the Data tab在Excel功能区上,单击“数据”选项卡
  • Click Text to Columns单击文本到列

In Step 1, select Delimited, and click Next

在步骤1中,选择“定界”,然后单击“下一步”。

  • In Step 2, select Space as the delimiter, and the preview pane should show the dates divided into columns.在第2步中,选择“空格”作为定界符,然后预览窗格应显示分为几列的日期。
  • Click Next点击下一步

In Step 3, you can set the data type for each column:

在步骤3中,您可以为每一列设置数据类型:

  • In the preview pane, click on the date column, and select Date在预览窗格中,单击日期列,然后选择日期
  • In the Date drop down, choose the date format that your dates are currently displayed in. In this example, the dates show month/day/year, so I’ve selected MDY.在“日期”下拉列表中,选择当前显示日期的日期格式。在此示例中,日期显示为月/日/年,因此我选择了MDY。
  • Select each of the remaining columns, and set it as “Do not import column (skip)”选择其余的每个列,并将其设置为“不导入列(跳过)”
  • Click Finish, to convert the text dates to real dates.单击完成,将文本日期转换为实际日期。

格式化日期 (Format the Dates)

Now that the dates have been converted to real dates (stored as numbers), you can format them with the Number Format commands.

现在,日期已转换为实际日期(存储为数字),您可以使用数字格式命令将其格式化。

There are a few signs that the cell contents are now being recognized as real dates (numbers):

有迹象表明,单元格内容现在已被识别为实际日期(数字):

  • The dates are right-aligned日期右对齐
  • There is no apostrophe at the start of the date (visible in the formula bar)日期开头没有撇号(在编辑栏中可见)
  • If two or more dates are selected, the Quick Calc in the Status Bar shows Count, Numerical Count and Sum.如果选择了两个或多个日期,则状态栏中的“快速计算”将显示“计数”,“数字计数”和“总和”。

To format the dates, select them, and use the quick Number formats on the Excel Ribbon, or click the dialog launcher, to see more formats.

要设置日期格式,请选择日期,然后使用Excel功能区上的快速数字格式,或单击对话框启动器以查看更多格式。

Everything should work correctly, after you have converted the text dates to real dates.

将文本日期转换为实际日期后,一切都应正常工作。

下载样本文件 (Download the Sample File)

To follow along with this tutorial, get the Date Format Fix Sample file from my Contextures website, on the Excel Dates Fix Format page.

要继续本教程,请从Contextures网站上的Excel Dates Fix Format页面上获取Date Format Fix Sample文件。

翻译自: https://contexturesblog.com/archives/2014/01/30/excel-dates-wont-change-format/

excel更改日期格式无效


http://www.taodudu.cc/news/show-4190483.html

相关文章:

  • 关于js导入Excel时,Excel的(年/月/日)日期是五位数字的问题。以及对Excel日期存在的错误的分析和处理。
  • java 导入excel 日期格式转换
  • Excel日期运算单,多条件求和与计数
  • Python xlrd读取、处理excel日期类型
  • php 导入excel 日期格式值处理
  • codeforces 1520E. Arranging The Sheep(1400)
  • Arranging The Sheep 中位数定理
  • codeforces 1520E Arranging The Sheep
  • E. Arranging The Sheep
  • Arranging Heaps
  • spoj2142 Arranging Flowers
  • Arranging Coins 排列硬币
  • leetcode (Arranging Coins)
  • Day 5 E. Arranging The Sheep
  • Arranging Wine
  • Arranging The Sheep(移动思维)
  • CF1520E Arranging The Sheep
  • Arranging The Sheep
  • 【leetcode刷题】[简单]441. 排列硬币(arranging coins)-java
  • LeetCode - 441 - 排列硬币(arranging-coins)
  • C语言sem Take函数,信号量函数sem.c
  • SEM和SD的区别和联系,以及其计算方法
  • sem_init函数用法
  • python可以构建sem模型_Python Pandas Series.sem()用法及代码示例
  • sem_wait和sem_post
  • SD SEM 区别
  • SEM和SD的区别和联系,以及其计算方法(实际作图方法)
  • sd和sem啥区别_生物统计学-标准差(SD)和标准误(SEM)有何区别.pdf
  • 火狐打不开qq空间,说“建立安全连接失败”,解决方案
  • BurpSuite抓包出现建立安全连接失败(Software is Preventing Firefox From Safely Connecting to This Si)

excel更改日期格式无效_Excel日期不会更改格式相关推荐

  1. python关于excel格式刷_Excel技巧—开始菜单之格式刷六大功能

    点赞再看,养成习惯:千里之行,始于足下. 微信搜索[亦心Excel]关注这个不一样的自媒体人. 本文 GitHub 今天我们主要学习的是"第一区块-剪贴板"中的"格式刷& ...

  2. python excel 格式刷_Excel技巧—开始菜单之格式刷六大功能

    点赞再看,养成习惯:千里之行,始于足下. 微信搜索[亦心Excel]关注这个不一样的自媒体人. 本文 GitHub https://github.com/hugogoos/Excel 已收录,包含Ex ...

  3. 切片器可以设置日期格式?_Excel智能表格——套用表格格式,“一键变身”

    大家好,我是执着于研究Office小技巧的Angie-- Excel表格堪称职场达人必做项,为了追求美观可视化,每次都要手动操作对表格边框.单元格填充.字体大小进行设置,重点是每次自定义设置完,不仅没 ...

  4. mysql中日期相减_Excel日期和时间运算

    对于Excel的日期和时间运算一般人都很头疼,文章的开始我先给大家说个真理吧,遇到这种问题,不管三七二十一,直接暴力相加或相减,然后把运算结果设置成日期或时间格式,结果也许就有了. 下边我把日期和时间 ...

  5. excel图标变成未知图标_Excel 2003中的条件格式图标

    excel图标变成未知图标 In Excel 2007, conditional formatting options include Icon Sets, such as coloured flag ...

  6. excel 日期选择器_Excel日期选择器工具

    excel 日期选择器 If you'd like a quick and easy way to add dates in a worksheet, you can use this handy d ...

  7. 电脑表格日期怎么修改原有日期_“电脑表格日期格式怎么改“如何把excel中日期格式设置为2001-01-01...

    如何在EXCEL中改变日期格式 1.打开需置日期格式的excel表. 2.选中日期所在的格,单击鼠键,选择"设置单元格格式"选项. 3.在弹对话框"数字"标签中 ...

  8. excel减法函数_excel日期函数:如何计算项目的开始和完成日期

    编按:哈喽,大家好!在上一篇文章中,我们说到了EDATE.DATEDIF.EOMONTH.WEEKDAY等日期函数,相信大家对于excel中的日期计算,已经有了一个大致的了解,今天我们继续上篇内容,为 ...

  9. oracle 导入excel时间格式,excel表格导入时间数据库中-excel导入数据库,我的日期是datatime()自动生成......

    如何将excel表格数据导入到oracle数据库对应的表中? 假定a1是你的mysql中的时间戳,要在B1取得普通的时间表示,则b1= =25569 A1*0.0000115743621516652 ...

最新文章

  1. 【Git版本控制】为什么要先commit,然后pull,最后再push?而不是commit然后直接push?...
  2. 计算机文字识别的过程包括哪些步骤,电脑上的文字识别工具怎么使用?
  3. Allegro 光绘文件快速导入
  4. 获“CAIS紫金奖”,腾讯民汉翻译践行“科技向善”
  5. windows pip命令不见了_Python中Pygame以及pip的下载与安装
  6. jmeter的java请求参数设置_Jmeter中json数据参数化、断言设置
  7. sql基础语法(增、删、改、查)
  8. linux 的截屏软件下载,Linux 截屏软件 Shutter
  9. Win10操作系统下,如何确定电脑位数(图文教程)
  10. winxp怎么打开无线网络服务器,WinXP无线网络设置的方法
  11. 从MP3到种子王者海盗湾, 鬼知道今天的去中心化都经历了些什么
  12. 股票、基金、场内ETF基金下载数据代码例子
  13. RFID天线技术 – 低频和高频RFID天线设计
  14. python文章抄袭检测_CSDN文章被洗稿、抄袭严重!用Python做一个“基于搜索引擎的文章查重工具”,解决!...
  15. 如何给excel的单元格添加斜线并在对角线
  16. python谷歌小恐龙,这还是你断网时的样子嘛~
  17. sau交流学习社区--songEagle开发系列:Vue.js + Koa.js项目中使用JWT认证
  18. elsearch mysql实时索引_MySQL和Lucene(Elasticsearch)索引对比分析
  19. 个人知识体系你了解多少?
  20. Android移动开发-使用摄像头和麦克风录制视频的实现

热门文章

  1. android国外壁纸app,4K Wallpapers,火遍全球的4K高清壁纸App,谷歌市场1300万好评!...
  2. Ardupilot代码学习笔记
  3. Spark数据倾斜优化
  4. android撕衣服案例解析
  5. word没有标题3和标题4的解决方式
  6. HCL华三模拟器静态路由实验
  7. 三八节活动答题运营复盘
  8. 微信分享次数统计、微信公众号分享关注统计
  9. ROS学习小笔记(Topic通信 ,service通信,参数服务器)
  10. 电信物联网平台SOTA升级(软件升级)的全流程说明