Re: Formula for current month minus one = Quarter number in a macr
- From: "Harald Staff" <innocent@xxxxxxxxxxxxx>
- Date: Tue, 21 Jun 2005 13:50:06 +0200
"Pank" <Pank@xxxxxxxxxxxxxxxxxxxxxxxxx> skrev i melding
news:22DE3522-7970-490D-8F3D-B58A51C3E2DE@xxxxxxxxxxxxxxxx
> 'MyQ = 1 + Int(Month(DateSerial(Year(Date), Month(Date) - 1, 1)) / 4)
>
> Can you please clarify whether the digit 4 is correct or should it be 3 to
> represent quarters (i.e. every 3 months)?
Doh ! Really sorry about that. This is more like what I intended:
MyQ = 1 + Int((Month(DateSerial(Year(Date), Month(Date) - 1, 1)) - 1) / 3)
it will return for each month
jan 4
feb 1
mar 1
apr 1
may 2
jun 2
jul 2
aug 3
sep 3
oct 3
nov 4
dec 4
but it may not be what you wanted.
Best wishes Harald
.
- Follow-Ups:
- References:
- Formula for current month minus one = Quarter number in a macro.
- From: Pank
- Re: Formula for current month minus one = Quarter number in a macro.
- From: Bob Phillips
- Re: Formula for current month minus one = Quarter number in a macr
- From: Pank
- Re: Formula for current month minus one = Quarter number in a macr
- From: Harald Staff
- Re: Formula for current month minus one = Quarter number in a macr
- From: Pank
- Formula for current month minus one = Quarter number in a macro.
- Prev by Date: RE: large numbers not losing the end without formatting column
- Next by Date: Re: Conditional Formatting
- Previous by thread: Re: Formula for current month minus one = Quarter number in a macr
- Next by thread: Re: Formula for current month minus one = Quarter number in a macr
- Index(es):
Relevant Pages
|