Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula to subtract 1 from month 1

Status
Not open for further replies.

johngiggs

Technical User
Oct 30, 2002
492
US
I imported some data into Excel, however the dates are incorrect, so I would like to roll back the date by 1 month. I.E. if the field says 10/13/2003, I would like to change it to 09/13/03. If there is a way to do so, is it possible to also correct the year if you change 01/13/04 to the previous month, which is supposed to be 12/13/03?

Below is a sample of the input:

Event Date Payment Interest Principal Balance
Loan 10-02-2003 17,754.81
1 11-02-2003 301.85 102.09 199.76 17,555.05
2 12-02-2003 301.85 100.94 200.91 17,354.14
2003 Total 603.70 203.03 400.67

3 01-02-2004 301.85 99.79 202.06 17,152.08
4 02-02-2004 301.85 98.62 203.23 16,948.85
5 03-02-2004 301.85 97.46 204.39 16,744.46
6 04-02-2004 301.85 96.28 205.57 16,538.89
7 05-02-2004 301.85 95.10 206.75 16,332.14
8 06-02-2004 301.85 93.91 207.94 16,124.20
9 07-02-2004 301.85 92.71 209.14 15,915.06
10 08-02-2004 301.85 91.51 210.34 15,704.72
11 09-02-2004 301.85 90.30 211.55 15,493.17
12 10-02-2004 301.85 89.09 212.76 15,280.41
13 11-02-2004 301.85 87.86 213.99 15,066.42
14 12-02-2004 301.85 86.63 215.22 14,851.20
2004 Total 3,622.20 1,119.26 2,502.94

Any help on resolving this issue would be greatly appreciated.

Thanks,

John
 
This formula will bump a date in cell A1 back 1 month



=MONTH(EOMONTH(A1,-1))&"/"&DAY(A1)&"/"&YEAR(EOMONTH(A1,-1))
 
Oooops....forgot about leap year.


try this one instead



=MONTH(EOMONTH(A1,-1))&"/"&DAY(EOMONTH(A1,-1))&"/"&YEAR(EOMONTH(A1,-1))
 
The simplest way to do this is:

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

But beware of what Skip said.



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
This one works ...(logically)
....with a date in A1,...this formula in b1 will bump you back one calendar month (and show the maximun corresponding day that the previous month will allow.

=MONTH(EOMONTH(A1,-1))&"/"&DAY(EOMONTH(A1,-1))&"/"&YEAR(EOMONTH(A1,-1))
 
Thanks, Bowers74!! That worked great. ETID, I tried all three of your formulas and I couldn't get any of them working. It kept returning #NAME?

Thanks,

John
 
If this function is not available, run the Setup program to install the Analysis ToolPak. After you install the Analysis ToolPak, you must enable it by using the Add-Ins command on the Tools menu.

 
Thanks, ETID!! It is working now. I'm no Excel guru, so I had no idea that the add-ins even existed.

Thanks,

John
[afro]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top