Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Daniel Bonallack
 
Posts: n/a
Default Getting a date six months back

I want to be able to enter a date in cell A1, and have cell B1 be the last
day of the month, six months earlier

So if I enter 7/18/2005, the date in B1 would be 1/31/2005.
8/3/05 would 2/28/05 (and would adjust if this were a leap year).

Can someone help me with this formula?

Thanks very much.

Daniel
  #2   Report Post  
William Horton
 
Posts: n/a
Default

There may be a simpler way but this formula worked for me. If you don't have
the EOMONTH function in your Excel, install the add in Analysis Toolpack by
following the menu path Tools / Addin's and choosing the appropriate option.

Try this formula:
=EOMONTH(IF(MONTH(G1)-6<1,DATEVALUE(CONCATENATE(MONTH(G1)+6,"/",1,"/",YEAR(G1)-1)),DATEVALUE(CONCATENATE(MONTH(G1)-6,"/",1,"/",YEAR(G1)))),0)

Substitute your cell for G1.

Hope this helps.

Thanks,
Bill Horton

"Daniel Bonallack" wrote:

I want to be able to enter a date in cell A1, and have cell B1 be the last
day of the month, six months earlier

So if I enter 7/18/2005, the date in B1 would be 1/31/2005.
8/3/05 would 2/28/05 (and would adjust if this were a leap year).

Can someone help me with this formula?

Thanks very much.

Daniel

  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 3 Aug 2005 11:02:03 -0700, "Daniel Bonallack"
wrote:

I want to be able to enter a date in cell A1, and have cell B1 be the last
day of the month, six months earlier

So if I enter 7/18/2005, the date in B1 would be 1/31/2005.
8/3/05 would 2/28/05 (and would adjust if this were a leap year).

Can someone help me with this formula?

Thanks very much.

Daniel



=EOMONTH(A1,-6)

If this function is not available, and returns the #NAME? error, install and
load the Analysis ToolPak add-in.


On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.

--ron
  #4   Report Post  
Daniel Bonallack
 
Posts: n/a
Default

Bill, Ron, thanks a lot.

Daniel

"Ron Rosenfeld" wrote:

On Wed, 3 Aug 2005 11:02:03 -0700, "Daniel Bonallack"
wrote:

I want to be able to enter a date in cell A1, and have cell B1 be the last
day of the month, six months earlier

So if I enter 7/18/2005, the date in B1 would be 1/31/2005.
8/3/05 would 2/28/05 (and would adjust if this were a leap year).

Can someone help me with this formula?

Thanks very much.

Daniel



=EOMONTH(A1,-6)

If this function is not available, and returns the #NAME? error, install and
load the Analysis ToolPak add-in.


On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.

--ron

  #5   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 3 Aug 2005 13:58:01 -0700, "Daniel Bonallack"
wrote:

Bill, Ron, thanks a lot.

Daniel


You're welcome. Glad to help.


--ron


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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
how do I make a word typed in a cell go to a specific cell in anot Lmatarazzo Excel Discussion (Misc queries) 3 April 21st 05 04:29 AM
Convert date to length of time in months from set date MJUK Excel Worksheet Functions 1 March 19th 05 06:31 PM
Return a date 6 months from a date in another cell Qaspec Excel Worksheet Functions 1 January 21st 05 04:59 PM
Roll back to previous date Jay Excel Worksheet Functions 2 December 3rd 04 03:35 PM


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