View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Calculation of Quarter

"kashish" wrote:
1st quarter is from 28/12/08 to 28/03/09 (13 week)
2nd quarter is from 29/03/09 to 27/06/09 (13 week)
3rd quarter is from 28/06/09 to 26/09/09 (13 week)
4th quarter is from 27/09/09 to 02/01/10 (14 week)


I am quite certain the 4th quarter is 27/09/09 to 27/12/09. Otherwise,
28/12/09 would fit into 08Q4 as well as 09Q1.

Put the following dates in some out-of-the-way column, say X1:X5:

1/1/2008
29/3/2008
28/6/2008
27/9/2008
28/12/2008

Then in B1 and copy down:

=lookup(date(2008,month(A1),day(A1)),X1:X5,{1,2,3, 4,1})

Note that this will work for a date in any year. The choice of
DATE(2008,...) has nothing to do with the fact that your dates start in
2008. It is chosen because it is a leap year; so Feb 29 is handled
correctly. (It would have been anyway, since the 2nd quarter does not start
until Mar 29. But we have to pick __some__ year; might as well handle Feb
correctly.)


----- original message -----

"kashish" wrote in message
...
All year divided in 4 quarter as given below

1st quarter is from 28/12/08 to 28/03/09 (13 week)
2nd quarter is from 29/03/09 to 27/06/09 (13 week)
3rd quarter is from 28/06/09 to 26/09/09 (13 week)
4th quarter is from 27/09/09 to 02/01/10 (14 week)

If A column has any date then I want a formula for number of quarter in
column B
For Example
A B
05/01/2009 1
20/03/2009 1
30/03/2009 2
05/06/2009 2
15/07/2009 3
11/09/2009 3
02/10/2009 4
27/12/2009 4