#1   Report Post  
Posted to microsoft.public.excel.misc
JPS JPS is offline
external usenet poster
 
Posts: 47
Default Calculate a quarter

I have a large spreadsheet that is a five-year forecast. In one column is a
date, I need to know a way to calculate the quarter, in XQYY format, the
event is forecasted to happen. Where X is the quarter from the table below, Q
is a set value and XX is the forecast year.

Date Range Quarter
January €“ March 1
April - June 2
July €“ September 3
October €“ December 4

For example, March 2009, would be 1Q09.

Thanks,

--
JPS
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Calculate a quarter

=TEXT(MONTH(A1)/4+1,"0")&"Q"&TEXT(MOD(YEAR(A1),100),"00")

Regards,
Fred.

"JPS" wrote in message
...
I have a large spreadsheet that is a five-year forecast. In one column is a
date, I need to know a way to calculate the quarter, in XQYY format, the
event is forecasted to happen. Where X is the quarter from the table
below, Q
is a set value and XX is the forecast year.

Date Range Quarter
January €“ March 1
April - June 2
July €“ September 3
October €“ December 4

For example, March 2009, would be 1Q09.

Thanks,

--
JPS


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Calculate a quarter

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786
  #4   Report Post  
Posted to microsoft.public.excel.misc
JPS JPS is offline
external usenet poster
 
Posts: 47
Default Calculate a quarter

GSNU200786 & Fred

Both solutions worked
As always thanks for the help....
Thanks
--
JPS


"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Calculate a quarter

Get incorrect results:

2/1/2008 = 2Q08
6/1/2008 = 3Q08

--
Biff
Microsoft Excel MVP


"Fred Smith" wrote in message
...
=TEXT(MONTH(A1)/4+1,"0")&"Q"&TEXT(MOD(YEAR(A1),100),"00")

Regards,
Fred.

"JPS" wrote in message
...
I have a large spreadsheet that is a five-year forecast. In one column is
a
date, I need to know a way to calculate the quarter, in XQYY format, the
event is forecasted to happen. Where X is the quarter from the table
below, Q
is a set value and XX is the forecast year.

Date Range Quarter
January - March 1
April - June 2
July - September 3
October - December 4

For example, March 2009, would be 1Q09.

Thanks,

--
JPS






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Calculate a quarter

Here's another one:

=CEILING(MONTH(A1)/3,1)&"Q"&TEXT(A1,"yy")

--
Biff
Microsoft Excel MVP


"JPS" wrote in message
...
I have a large spreadsheet that is a five-year forecast. In one column is a
date, I need to know a way to calculate the quarter, in XQYY format, the
event is forecasted to happen. Where X is the quarter from the table
below, Q
is a set value and XX is the forecast year.

Date Range Quarter
January - March 1
April - June 2
July - September 3
October - December 4

For example, March 2009, would be 1Q09.

Thanks,

--
JPS



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Calculate a quarter

You're right. The fractions need to be ignored:

=TEXT(INT(MONTH(A1)/4)+1,"0")&"Q"&TEXT(MOD(YEAR(A1),100),"00")

Regards,
Fred/


"T. Valko" wrote in message
...
Get incorrect results:

2/1/2008 = 2Q08
6/1/2008 = 3Q08

--
Biff
Microsoft Excel MVP


"Fred Smith" wrote in message
...
=TEXT(MONTH(A1)/4+1,"0")&"Q"&TEXT(MOD(YEAR(A1),100),"00")

Regards,
Fred.

"JPS" wrote in message
...
I have a large spreadsheet that is a five-year forecast. In one column is
a
date, I need to know a way to calculate the quarter, in XQYY format, the
event is forecasted to happen. Where X is the quarter from the table
below, Q
is a set value and XX is the forecast year.

Date Range Quarter
January - March 1
April - June 2
July - September 3
October - December 4

For example, March 2009, would be 1Q09.

Thanks,

--
JPS





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 947
Default Calculate a quarter

Too bad the worksheet doesn't have the same quarter formatting as vba.

Function Quarter_Year(d As Date)
Quarter_Year = Format(d, "q\Qyy")
End Function

--
Dana DeLouis


"JPS" wrote in message ...

I have a large spreadsheet that is a five-year forecast. In one column is a
date, I need to know a way to calculate the quarter, in XQYY format, the
event is forecasted to happen. Where X is the quarter from the table below, Q
is a set value and XX is the forecast year.

Date Range Quarter
January €“ March 1
April - June 2
July €“ September 3
October €“ December 4

For example, March 2009, would be 1Q09.

Thanks,

--
JPS
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Calculate a quarter

if cell A1 is empty I want it to report a 0 how can i do this. thanks in
advance. I am ccreating a template that calculate quarters but find that the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Calculate a quarter

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this. thanks in
advance. I am ccreating a template that calculate quarters but find that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786




  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Calculate a quarter

excellent, thank you I have been working on this for days

"Roger Govier" wrote:

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this. thanks in
advance. I am ccreating a template that calculate quarters but find that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786



  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Calculate a quarter

this formula worked
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0)

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?

I had modified the formula to this:
VLOOKUP(IF(F262="","",INT((MONTH(F262)-1)/3)+1),LOOKUP!$A$1:$B$4,2,FALSE)

Quarter New Quarter
1 1st
2 2nd
3 3rd
4 4th
but now I still have my original problem now the formula is reporting #NA
when the date cell is blank.
"Roger Govier" wrote:

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this. thanks in
advance. I am ccreating a template that calculate quarters but find that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786



  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Calculate a quarter

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?

Try this

=IF(COUNT(A1),INT((MONTH(A1)+2)/3)&MID("stndrdth",INT((MONTH(A1)+2)/3)*2-1,2),0)


--
Biff
Microsoft Excel MVP


"compben" wrote in message
...
this formula worked
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0)

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?

I had modified the formula to this:
VLOOKUP(IF(F262="","",INT((MONTH(F262)-1)/3)+1),LOOKUP!$A$1:$B$4,2,FALSE)

Quarter New Quarter
1 1st
2 2nd
3 3rd
4 4th
but now I still have my original problem now the formula is reporting #NA
when the date cell is blank.
"Roger Govier" wrote:

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this. thanks
in
advance. I am ccreating a template that calculate quarters but find
that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786





  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Calculate a quarter

Hi

It should be
=IF(F262="","",VLOOKUP(INT((MONTH(F262)-1)/3)+1,Lookup!$A$1:$B$4,2,FALSE))

--
Regards
Roger Govier

"compben" wrote in message
...
this formula worked
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0)

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?

I had modified the formula to this:
VLOOKUP(IF(F262="","",INT((MONTH(F262)-1)/3)+1),LOOKUP!$A$1:$B$4,2,FALSE)

Quarter New Quarter
1 1st
2 2nd
3 3rd
4 4th
but now I still have my original problem now the formula is reporting #NA
when the date cell is blank.
"Roger Govier" wrote:

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this. thanks
in
advance. I am ccreating a template that calculate quarters but find
that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786



  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Calculate a quarter

excellent!!! thanks, this one worked perfectly.

"T. Valko" wrote:

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?


Try this

=IF(COUNT(A1),INT((MONTH(A1)+2)/3)&MID("stndrdth",INT((MONTH(A1)+2)/3)*2-1,2),0)


--
Biff
Microsoft Excel MVP


"compben" wrote in message
...
this formula worked
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0)

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?

I had modified the formula to this:
VLOOKUP(IF(F262="","",INT((MONTH(F262)-1)/3)+1),LOOKUP!$A$1:$B$4,2,FALSE)

Quarter New Quarter
1 1st
2 2nd
3 3rd
4 4th
but now I still have my original problem now the formula is reporting #NA
when the date cell is blank.
"Roger Govier" wrote:

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this. thanks
in
advance. I am ccreating a template that calculate quarters but find
that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786







  #16   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Calculate a quarter

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"compben" wrote in message
...
excellent!!! thanks, this one worked perfectly.

"T. Valko" wrote:

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?


Try this

=IF(COUNT(A1),INT((MONTH(A1)+2)/3)&MID("stndrdth",INT((MONTH(A1)+2)/3)*2-1,2),0)


--
Biff
Microsoft Excel MVP


"compben" wrote in message
...
this formula worked
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0)

what if I want it to report 1st, 2nd, 3rd and 4th instead of 1,2,3 & 4?

I had modified the formula to this:
VLOOKUP(IF(F262="","",INT((MONTH(F262)-1)/3)+1),LOOKUP!$A$1:$B$4,2,FALSE)

Quarter New Quarter
1 1st
2 2nd
3 3rd
4 4th
but now I still have my original problem now the formula is reporting
#NA
when the date cell is blank.
"Roger Govier" wrote:

Hi

If you do want to show a 0 then use
=IF(A1="",0,ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))
or if you want the cell to remain blank, then
=IF(A1="","",ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2))

The reason it is returning Q1, is that empty date cells are taken to
be
00/01/1900, hence they fall into Month 1


--
Regards
Roger Govier

"Compben" wrote in message
...
if cell A1 is empty I want it to report a 0 how can i do this.
thanks
in
advance. I am ccreating a template that calculate quarters but find
that
the
template without dates is hshowing that it is the 1st quarter.

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786







  #17   Report Post  
Posted to microsoft.public.excel.misc
MMG MMG is offline
external usenet poster
 
Posts: 3
Default Calculate a quarter

In this formula, is there a way to change it to a fiscal year, being from
April to March (Apr, May, june being Q1)
And is there a way to have the year first folowed by the Qs?
Thank you

"Gary''s Student" wrote:

With a date in A1:

=ROUNDUP(MONTH(A1)/3,0) & "Q" & RIGHT(YEAR(A1),2)


--
Gary''s Student - gsnu200786

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
I want to round Int to quarter QUESTION-MARK Excel Worksheet Functions 3 January 8th 07 07:20 PM
Quarter Dates LR Excel Worksheet Functions 8 October 31st 06 10:27 AM
how to calculate time start & time finish in quarter hour Peter Wu Excel Discussion (Misc queries) 3 June 7th 06 12:58 AM
First and Last Day of the Quarter Wolfspaw Excel Worksheet Functions 6 March 4th 06 02:10 AM
Calculate % variance on previous quarters. Quarter %, etc. pivot DaveC Excel Discussion (Misc queries) 1 August 8th 05 06:45 PM


All times are GMT +1. The time now is 01:28 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"