#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Month

I have a column of dates, and I want a formula that will subtract one month
from that date. I can't simply subtract 30 from the date b/c sometimes that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Month

The previous month is:
=date(year(a1),month(a1)-1,day(a1))

Regards,
Fred

"lightbulb" wrote in message
...
I have a column of dates, and I want a formula that will subtract one month
from that date. I can't simply subtract 30 from the date b/c sometimes
that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Month

Try this:

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

Mind you, this will still cause some problems if you start with, say,
30th March, as 30th February does not exist. Similarly 31st July will
try to give 31st June, which will then become 1st July. What answers
do you want to see in these cases?

Hope this helps.

Pete

On Dec 22, 2:00*pm, lightbulb
wrote:
I have a column of dates, and I want a formula that will subtract one month
from that date. *I can't simply subtract 30 from the date b/c sometimes that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- *July 1 - 31=May 31). *Any *help?

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Month

try this: =EDATE(A1,-1)
[You must have Analysis Toolpak add-in installed in older versions than
"2007"]
Micky


"lightbulb" wrote:

I have a column of dates, and I want a formula that will subtract one month
from that date. I can't simply subtract 30 from the date b/c sometimes that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Month

I am working in Excel 2003


"מיכאל (מיקי) אבידן" wrote:

try this: =EDATE(A1,-1)
[You must have Analysis Toolpak add-in installed in older versions than
"2007"]
Micky


"lightbulb" wrote:

I have a column of dates, and I want a formula that will subtract one month
from that date. I can't simply subtract 30 from the date b/c sometimes that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Month

So...!?
'Tools' 'Add-Ins check the 'Analysis Toolpak" 'OK'
Micky


"lightbulb" wrote:

I am working in Excel 2003


"מיכאל (מיקי) אבידן" wrote:

try this: =EDATE(A1,-1)
[You must have Analysis Toolpak add-in installed in older versions than
"2007"]
Micky


"lightbulb" wrote:

I have a column of dates, and I want a formula that will subtract one month
from that date. I can't simply subtract 30 from the date b/c sometimes that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default Month

Thanks!

In these cases I want Feb. 28, and June 30....it has to be in the month
before...

"Pete_UK" wrote:

Try this:

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

Mind you, this will still cause some problems if you start with, say,
30th March, as 30th February does not exist. Similarly 31st July will
try to give 31st June, which will then become 1st July. What answers
do you want to see in these cases?

Hope this helps.

Pete

On Dec 22, 2:00 pm, lightbulb
wrote:
I have a column of dates, and I want a formula that will subtract one month
from that date. I can't simply subtract 30 from the date b/c sometimes that
will still be in the same month (i.e. - July 31 - 30 days= July 1)...and I
can't simply subtract 31, because seometimes that will be 2 months earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!


.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 449
Default Month


=IF(DAY(A1)DAY(DATE(YEAR(A1),MONTH(A1),0)),DATE(Y EAR(A1),MONTH(A1),0),DATE(YEAR(A1),MONTH(A1)-1,DAY(A1)))

HTH. Best wishes Harald

"lightbulb" wrote in message
...
Thanks!

In these cases I want Feb. 28, and June 30....it has to be in the month
before...

"Pete_UK" wrote:

Try this:

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

Mind you, this will still cause some problems if you start with, say,
30th March, as 30th February does not exist. Similarly 31st July will
try to give 31st June, which will then become 1st July. What answers
do you want to see in these cases?

Hope this helps.

Pete

On Dec 22, 2:00 pm, lightbulb
wrote:
I have a column of dates, and I want a formula that will subtract one
month
from that date. I can't simply subtract 30 from the date b/c sometimes
that
will still be in the same month (i.e. - July 31 - 30 days= July
1)...and I
can't simply subtract 31, because seometimes that will be 2 months
earlier
(i.e.- July 1 - 31=May 31). Any help?

Thanks!


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Retrieve data for previous 3, 6, 12 month given current month GB Excel Worksheet Functions 4 July 19th 07 11:58 PM
When using MONTH function on Blank Cell!! Returns Month=Jan! mahou Excel Discussion (Misc queries) 6 January 9th 06 02:46 AM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 10:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"