如何强制Excel自动填写上一年的列而不是当年? [英] How to force Excel to automatically fill prior year in column instead of current year?

查看:226
本文介绍了如何强制Excel自动填写上一年的列而不是当年?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:我将前一年的数据输入到Excel中。



每当我在日期列中输入日期时>(9月16日9/16),Excel自动将其格式化为9/16/12,其中12年为2012年,当年。



我从2012年的去年输入数据。我不想在2011年输入11。我希望Excel自动填充它,就像2012年一样,和12月一样31st。



最简单的修复是将Windows中的时钟设置回2011年的任何时间,但这往往会与网络想要让我回来,抱怨我的网络密码已经过期等等。



我更喜欢日期驻留在一个列中,因此选择替代列每天/每月不是我的选择。



人们会认为这是一个简单的修复,但是几个小时的搜索和我的Google-fu没有通过我。

解决方案

快速修复只需输入9/16,并将Excel更改为9/16/12。然后,当您完成输入日期时,在新的列中,输入公式 = A1-365 ,只需将公式全部复制,假设列A包含您输入的日期。



请注意:2012年是闰年,因此在您输入的2月28日之后的任何日期,您的公式将需要要 = A1-365.25 ,否则您的日期将在一天之前关闭。它不一定是365.25,只是大于365,小于366。



这是因为无论单元格中的日期格式是什么,Excel存储实际的日期是1900年1月0日以来的经过天数。(是的,1月0日不是真实的日期,但Excel认为是。)


Context: I'm entering prior year data into Excel.

Every time I type in the date in the date column ("9/16" for September 16th), Excel automatically formats it to "9/16/12", where 12 is 2012, the current year.

I'm entering data from last year in the current year 2012. I don't want to type the "11" for 2011. I want Excel to automatically populate it as it does with 2012, and as it did on December 31st.

The simplest fix is to set the clock in Windows back to any time in 2011, but that tends to muck with the network which wants to set me back and complains about my network password being out of date, etc.

I prefer the date to reside in a single column, so tabbing to alternate columns for day/month/year is not an option for me.

One would think this is a simple fix, but a couple hours searching and my Google-fu is failing me.

解决方案

A quick fix is to just enter 9/16 and let Excel change it to 9/16/12. Then when you are all done entering your dates, in a new column, enter the formula =A1-365, and just copy the formula all the way down, assuming column A contains the dates that you entered.

One watch-out on this: 2012 is a leap year, so for any dates after Feb 28 that you enter, your formula will need to be =A1-365.25 or else your dates will be off by one day. It doesn't have to be 365.25, just something larger than 365 and smaller than 366.

This works because no matter what the date format in the cell is, Excel stores the actual date as the number of elapsed days since January 0, 1900. (Yeah, January 0 isn't a real date, but Excel thinks it is.)

这篇关于如何强制Excel自动填写上一年的列而不是当年?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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