On Fri, 26 Aug 2005 12:07:01 -0700, "lucy" <[email protected]>
wrote:
>I have a three spreadsheets. Each represents a different year and each has
>one column with different dates within that year.
>Unfortunately I entered all of these dates in the default date format ie
>7-jan and did not enter a year. I now need to ensure the year is present in
>the date formula in some way ie 07/01/04 or any format that shows the year.
>Is there a quick way of changing this rather than retyping all.
It takes longer to type than to do.
First make a backup of your original data.
Assume your dates are in A2:An
1. In some unused column, row 2, let us say cell AA2, enter one of these
formulas:
=DATE(YEAR(A2)-1,MONTH(A2),DAY(A2))-
(MONTH(DATE(YEAR(A2)-1,MONTH(A2),
DAY(A2)))<>MONTH(A2))
or, if you have the analysis tool pak installed:
=EDATE(A2,-12)
The above will subtract one year (and adjust for leap year, if necessary).
To subtract more than one year, in formula one change the '1' to the number of
years you wish to subtract; or in formula 2 multiply the '12' by the number of
years you wish to subtract.
2. Copy/drag the formula down to AAn.
3. With AA2:AAn selected:
Edit/Copy
4. Select cell A2
5. Edit/Paste Special Values
--ron
Bookmarks