Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return a value that falls within a defined range Suzieq Excel Discussion (Misc queries) 2 July 25th 06 07:43 PM
EXCEL LOOKUP FISCAL YEAR WITH DATE Toni's Taxi Excel Worksheet Functions 2 February 5th 06 01:22 PM
"User-defined type not defined" message in Excel RW1946 Excel Discussion (Misc queries) 0 August 31st 05 12:14 PM
user defined date [email protected] Excel Worksheet Functions 1 January 21st 05 08:57 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM


All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"