View Single Post
  #12   Report Post  
Bruce
 
Posts: n/a
Default

SongBear,

You hit the nail on the head. I was thinking along that direction of
changing to a set time, regardless of the month ends, etc. So, yes, your
input helped a great deal!

Again, thank you very much.

Bruce

"SongBear" wrote:

Bruce, actually the problem may be simpler than you are making it. Think
about the requirement of one month. What does that stand for within your
business rules?
and where does that minus one day come from, too?
Would 28 days (4 weeks) do just as well? One simplification is: that would
automatically land you on a week day if you always started on a week day. And
it might automatically take care of the need that always subtracting a day is
covering. You are automatically approximately a month (4 weeks) later, yet at
lease one day or more ahead of an exact month for about 45 months out of 48
(it is the same day on each february except leap years).
But if you gotta have the McGimpsey - and it is purty - then i probably will
have to be tweaked.
Let us know if any of this helped.
SongBear

"Bruce" wrote:

Thanks, Ron, for your reply.

No, the base date from which I begin the calculations will never be anything
but a weekday.

Bruce

"Ron Rosenfeld" wrote:

On Wed, 18 May 2005 13:25:02 -0700, "Bruce"
wrote:

Hope I can explain this clearly. If this, or something like it, has been
answered before, please direct me to the post.

I have a worksheet in which I need to calculate the future date, one month
from the date in another cell, less one day. (ex. 5/18/2005 to 6/17/2005). If
the calculated day is a weekend (Saturday or Sunday) I need to return the
immediately previous Friday. So, if I am calculating the date based on an
original entry of 5/20/2005, the date may come back as 6/19/2005, a Sunday,
so I would instead need to get to 6/17/2005.

Presently I see that this would probably entail a LOT of nested functions to
cover February and the move from December to January, etc. Just wondering if
there's a simpler way to approach this (aside from just manually entering the
dates after visually determining the correct date).

Thanks in advance!

The problem, as you have realized, is that "month" does not have a definite
number of days. So you have to define what you want to happen when the
subsequent month has fewer days than the base month.

Also, is it possible for the base date to occur on a weekend?

For example:

Monday 31 Jan 2005 -- ??



--ron