Solved

# Excel User Function to Calculate Date Minus One Year

Posted on 2015-01-06
160 Views
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
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

LVL 47

Expert Comment

ID: 40534845
You can use this formula...

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

...where cell A1 contains the date.
0

LVL 12

Expert Comment

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

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

=EDATE(A1,-12)

Kris
0

LVL 33

Expert Comment

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

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

ID: 40535748
Or do a Find & Replace for 2015 replacing with 2014.
0

LVL 50

Expert Comment

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

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

## Featured Post

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
###### Suggested Courses
Course of the Month5 days, 2 hours left to enroll