Home » excel » Is there a mass edit in Excel that can roll back the day in a date by 1 and the year forward by 1?

Is there a mass edit in Excel that can roll back the day in a date by 1 and the year forward by 1?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have a spreadsheet with cells dated for every day of the year. My dates are in the following format:

m/d/yyyy 1/23/2013

I need each date (all 365) to roll the day back 1 and the year forward 1.

1/23/2013 –> 1/22/2014

     or

2/1/2013 –> 1/31/2014

As of right now I have to change it cell by cell. Is there a way to edit them all at once? Every date in the spreadsheet is in this format, and needs this change. Thanks!

How to&Answers:

Yes there is. It is called Pastespecial | Values with Operation as Add

Type 364 in any blank cell and copy it. Select your range which has dates and do Pastespecial | Values with Operation as Add

enter image description here

Answer:

If one of your source numbers is in A1, you can use the following formula

=A1+364

to get the result. Then make sure you use a suitable number format.

I assume that when you say “all 365” you mean there are no leap years to take care of.
Otherwise, use

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

which is good for any date.