How to tell which fiscal qtr a user defined date falls in, excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to determine whihc fiscal quarter a date falls in. The begin and end
dates fo the fiscal year are user defined.
 
Function WhichQuarter(ByRef dteToAllocate As Date) As String
'Jim Cone - San Francisco USA - October 2005
Const Q1End As Date = #3/31/2005#
Const Q2End As Date = #6/30/2005#
Const Q3End As Date = #9/30/2005#
Const Q4End As Date = #12/31/2005#

Select Case True
Case dteToAllocate <= Q1End
WhichQuarter = "Date occurs in First Quarter "
Case dteToAllocate <= Q2End
WhichQuarter = "Date occurs in Second Quarter "
Case dteToAllocate <= Q3End
WhichQuarter = "Date occurs in Third Quarter "
Case dteToAllocate <= Q4End
WhichQuarter = "Date occurs in Fourth Quarter "
End Select
End Function

'Call function
Sub FindQuarter()
MsgBox WhichQuarter("07/30/2005")
End Sub


"jwmott" <[email protected]>
wrote in message
I need to determine whihc fiscal quarter a date falls in. The begin and end
dates fo the fiscal year are user defined.
 
Another approach...
'-------------
Sub GetTheQuarter()
Dim strQ As String
strQ = Format$("07/30/2005", "q", 0, 0)
MsgBox strQ
End Sub
'-------------
Jim Cone
San Francisco, USA



"jwmott" <[email protected]>
wrote in message
I need to determine whihc fiscal quarter a date falls in. The begin and end
dates fo the fiscal year are user defined.
 
Back
Top