Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to tell which fiscal qtr a user defined date falls in, excel
I need to determine whihc fiscal quarter a date falls in. The begin and end
dates fo the fiscal year are user defined. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to tell which fiscal qtr a user defined date falls in, excel
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" 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to tell which fiscal qtr a user defined date falls in, excel
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" 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return a value that falls within a defined range | Excel Discussion (Misc queries) | |||
EXCEL LOOKUP FISCAL YEAR WITH DATE | Excel Worksheet Functions | |||
"User-defined type not defined" message in Excel | Excel Discussion (Misc queries) | |||
user defined date | Excel Worksheet Functions | |||
User-defined data type; Error: Only User-defined types... | Excel Programming |