Data Validation for end of Month

C

Casey

Hi Everybody,
I need a drop down list based on the current date that would display
the previous 4 end of month dates, the current end of month date and 3
future end of month dates. And I'm hoping it would change based on the
actual current date.

As an example using today 2/8/06 the drop down would display the
following:

October 31, 2005
November 30, 2005
December 31, 2005
January 31, 2006
February 28, 2006
March 31, 2006
April 30, 2006
May 31, 2006

This could be a data validation formula or a VBA solution of some kind.
 
G

Guest

Put these formulas somewhere in your worksheet, and refer to this list in the
validation menu. If you have the list on another worksheet, you will need to
define the list name and refer to that name with an "=" in the source box.

=DATE(YEAR(TODAY()),MONTH(TODAY())-3,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())-2,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())-1,0)
=DATE(YEAR(TODAY()),MONTH(TODAY()),0)
=DATE(YEAR(TODAY()),MONTH(TODAY())+1,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())+2,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())+3,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())+4,0)
 
A

Andrew Taylor

You can always get the last day of a month by calling it the
zeroth day of the next month. So set up a range with

=DATE(YEAR(TODAY()),MONTH(TODAY())-3,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())-2,0)
etc up to
=DATE(YEAR(TODAY()),MONTH(TODAY())+4,0)

formatted as "mmmm d, yyyy"
and use that as the source (*ListFillRange") of your dropdown
 
A

Andrew Taylor

You can always get the last day of a month by calling it the
zeroth day of the next month. So set up a range with

=DATE(YEAR(TODAY()),MONTH(TODAY())-3,0)
=DATE(YEAR(TODAY()),MONTH(TODAY())-2,0)
etc up to
=DATE(YEAR(TODAY()),MONTH(TODAY())+4,0)

formatted as "mmmm d, yyyy"
and use that as the source (*ListFillRange") of your dropdown
 
C

Casey

Andrew & Sloth,
Thank you for your replies. I'm pretty good with most functions and
features of Excel. But working with dates is my biggest weak point.
Your solution works well. Thanks for the time, experience and brain
power.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top