LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default Subtracting 1 year from todays date

To Ron and Ron,

You are both right again and I am wrong. Still!;

Anyway thanks for the feedback because I have gained a little more knowledge
from the discussion.

Regards,

OssieMac

"OssieMac" wrote:

Hi to all,

After my initial reply which was rather complex, I found all the replies to
this rather intriging since there are so many comments about the reliability
of the various methods and decided to perform some tests. I thought I should
share my results.

EDATE function certainly works well with 12 months. I couldn't fault it.
However, depending on the results that a user wants, it does not necessarily
return the last day of the month if adding or subtracting months other than
12.

In following examples: A1 = 30 Sep 2007
=EDATE(A1,-1) return 30 Aug 2007
=EDATE(A1,1) returns 30 Oct 2007

However, by using EOMONTH in conjunction with EDATE, I was able to return
the end of the month in all instances of adding and subtracting months. I was
not able to fault it even with 29 Feb in leap years.

In following examples: A1 = 30 Sep 2007
=EOMONTH(EDATE(A1,-1),0) returns 31 Aug 2007
=EOMONTH(EDATE(A1,+1),0) returns 31 Oct 2007

In following examples: A1 = 29 Feb 2008
=EOMONTH(EDATE(A1,-1),0) returns 31 Jan 2008
=EOMONTH(EDATE(A1,1),0) returns 31 Mar 2008

I am interested in further comments, particularly if anyone can fault the
logic.

Regards,

OssieMac



 
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
Todays date Kevin Excel Discussion (Misc queries) 3 May 19th 07 08:19 PM
Todays date rexmann Excel Discussion (Misc queries) 5 January 12th 06 03:18 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
When I open my past invoice it keeps changing date to todays date Stop date changing to todays in Excel Excel Worksheet Functions 2 October 7th 05 04:54 PM
I want todays date in my spreadsheet to be red. I also want this. Leah Wright New Users to Excel 1 April 14th 05 03:04 PM


All times are GMT +1. The time now is 06:41 PM.

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

About Us

"It's about Microsoft Excel"