Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Month Calculation

I've got a spreadsheet and in cell A2 the user will input
a date. I'm trying to provide a calculation for cell B2
that will subtract 1 month from the date in cell A2.

For instance, if the user types in December 12, 2003, then
cell B2 would calculate to November 12, 2003. Of if they
type in March 3, 2004, cell B2 would calculate to February
3, 2004. Of course the calculation would have to take
into consideration that some months have 30 or 31 days and
in the case of February 28 or 29 days.

Any assistance someone could provide to me would be
greatly appreciated.

Thanks,

Jamie
..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Month Calculation

Jamie, try this in B2 =DATE(YEAR(A2),MONTH(A2)-1,DAY(A2))

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **

"Jamie" wrote in message
...
I've got a spreadsheet and in cell A2 the user will input
a date. I'm trying to provide a calculation for cell B2
that will subtract 1 month from the date in cell A2.

For instance, if the user types in December 12, 2003, then
cell B2 would calculate to November 12, 2003. Of if they
type in March 3, 2004, cell B2 would calculate to February
3, 2004. Of course the calculation would have to take
into consideration that some months have 30 or 31 days and
in the case of February 28 or 29 days.

Any assistance someone could provide to me would be
greatly appreciated.

Thanks,

Jamie
.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Month Calculation

so if it is Mar 31, what do you want the result to be? Would Mar 28 - 31
all resolve to Feb 28 for non leap years and Mar 29-31 all resolve to Feb 29
for leap years? Certainly such can be considered, but you haven't defined
what the resolution is.



--
Regards
Tom Ogilvy

"Jamie" wrote in message
...
I've got a spreadsheet and in cell A2 the user will input
a date. I'm trying to provide a calculation for cell B2
that will subtract 1 month from the date in cell A2.

For instance, if the user types in December 12, 2003, then
cell B2 would calculate to November 12, 2003. Of if they
type in March 3, 2004, cell B2 would calculate to February
3, 2004. Of course the calculation would have to take
into consideration that some months have 30 or 31 days and
in the case of February 28 or 29 days.

Any assistance someone could provide to me would be
greatly appreciated.

Thanks,

Jamie
.




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
Month Calculation Tony Excel Worksheet Functions 4 July 17th 07 12:02 PM
Help!!! End of Month Calculation Tony Excel Worksheet Functions 4 February 16th 07 09:07 AM
Month end calculation Tony Excel Worksheet Functions 12 March 24th 06 12:56 AM
Month end calculation Tony Excel Discussion (Misc queries) 2 March 23rd 06 01:24 AM
month-to-month calculation Colin2u Excel Discussion (Misc queries) 0 July 27th 05 01:32 AM


All times are GMT +1. The time now is 06:35 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"