Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel User Function to Calculate Date Minus One Year

Posted on 2015-01-06
8
Medium Priority
?
179 Views
Last Modified: 2015-01-07
I am looking for a custom function for Excel 2010 that will take a date such as 5/25/2015 and turn it into 5/25/2014. I am entering dates of receipts for 2014.  When I enter 5/25 it defaults to 2015 when I want to be 2014.
0
Comment
Question by:Alex Campbell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 40534845
You can use this formula...

    =DATE(YEAR(A1)-1, MONTH(A1), DAY(A1))

...where cell A1 contains the date.
0
 
LVL 15

Expert Comment

by:Alan
ID: 40534850
Hi,

If you enter a date with only the day / month, excel assumes you mean the current year.

One way to make it use 2014 instead, is to just adjust your computer clock to a year ago while you are doing the data entry, and then change it back again after.

Alan.
0
 
LVL 18

Accepted Solution

by:
krishnakrkc earned 2000 total points
ID: 40534863
Or you can use this formula as well.

=EDATE(A1,-12)

Kris
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 33

Expert Comment

by:Rob Henson
ID: 40535424
Expanding on Alan's comment, Excel assumes current year so for entries where you know it is prior year ensure you enter the year as well, ie 5/25/14.

Thanks
Rob H
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 40535681
If you have a range of date values which all have the year 2015 but you need them to be 2014 then a quick way to change them all without formulas is as follows:

put 365 in any blank cell and copy that cell
select range of dates to convert then "right-click" and choose "Paste Special" from menu and in the dialog box under "operation" choose "subtract"
Choose "OK" then press "Esc" key

You may need to reformat the dates in your required date format

regards, barry
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40535748
Or do a Find & Replace for 2015 replacing with 2014.
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 40535780
Hey Rob,

Nice one - I didn't know that would work with real dates, assumed it would only work with text values

Learn something every day........

regards, barry
0
 
LVL 1

Author Closing Comment

by:Alex Campbell
ID: 40536385
Works well in my test and I like it that is short as well as dynamic.
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question