Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Count of days in a quarter

Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Count of days in a quarter

One way

=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),IF(DAY(DATE(YEAR(A1),2,29))=29,91,90),91,92,92 )

will take care of leap years as well

if only for 2007


=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),90,91,92,92)



--

Regards,

Peo Sjoblom

"Mahesh" wrote in message
...
Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Count of days in a quarter

No need for the call to INDEX.

=CHOOSE(INT((MONTH(A1)+2)/3),90+(DAY(DATE(YEAR(A1),2,29))=29),91,92,92)

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
One way

=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),IF(DAY(DATE(YEAR(A1),2,29))=29,91,90),91,92,92 )

will take care of leap years as well

if only for 2007


=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),90,91,92,92)



--

Regards,

Peo Sjoblom

"Mahesh" wrote in message
...
Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh





  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Count of days in a quarter

Yes and no, if you are going to be able to adapt it to financial quarters
yes, but if you are using simple calendar quarters like what the OP asked
for then you are right that there is no need for the index.


--

Regards,

Peo Sjoblom

"T. Valko" wrote in message
...
No need for the call to INDEX.

=CHOOSE(INT((MONTH(A1)+2)/3),90+(DAY(DATE(YEAR(A1),2,29))=29),91,92,92)

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
One way

=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),IF(DAY(DATE(YEAR(A1),2,29))=29,91,90),91,92,92 )

will take care of leap years as well

if only for 2007


=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),90,91,92,92)



--

Regards,

Peo Sjoblom

"Mahesh" wrote in message
...
Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh







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

Yeah, good point about financial quarters.

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
Yes and no, if you are going to be able to adapt it to financial quarters
yes, but if you are using simple calendar quarters like what the OP asked
for then you are right that there is no need for the index.


--

Regards,

Peo Sjoblom

"T. Valko" wrote in message
...
No need for the call to INDEX.

=CHOOSE(INT((MONTH(A1)+2)/3),90+(DAY(DATE(YEAR(A1),2,29))=29),91,92,92)

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
One way

=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),IF(DAY(DATE(YEAR(A1),2,29))=29,91,90),91,92,92 )

will take care of leap years as well

if only for 2007


=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),90,91,92,92)



--

Regards,

Peo Sjoblom

"Mahesh" wrote in message
...
Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh










  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default Count of days in a quarter

Here's another way

=SUM(DATE(YEAR(A1),FLOOR(MONTH(A1)-1,3)+{1,4},1)*{-1,1})

"T. Valko" wrote:

Yeah, good point about financial quarters.

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
Yes and no, if you are going to be able to adapt it to financial quarters
yes, but if you are using simple calendar quarters like what the OP asked
for then you are right that there is no need for the index.


--

Regards,

Peo Sjoblom

"T. Valko" wrote in message
...
No need for the call to INDEX.

=CHOOSE(INT((MONTH(A1)+2)/3),90+(DAY(DATE(YEAR(A1),2,29))=29),91,92,92)

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
One way

=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),IF(DAY(DATE(YEAR(A1),2,29))=29,91,90),91,92,92 )

will take care of leap years as well

if only for 2007


=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),90,91,92,92)



--

Regards,

Peo Sjoblom

"Mahesh" wrote in message
...
Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh









  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Count of days in a quarter

That's pretty slick. I like it!

--
Biff
Microsoft Excel MVP


"daddylonglegs" wrote in message
...
Here's another way

=SUM(DATE(YEAR(A1),FLOOR(MONTH(A1)-1,3)+{1,4},1)*{-1,1})

"T. Valko" wrote:

Yeah, good point about financial quarters.

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
Yes and no, if you are going to be able to adapt it to financial
quarters
yes, but if you are using simple calendar quarters like what the OP
asked
for then you are right that there is no need for the index.


--

Regards,

Peo Sjoblom

"T. Valko" wrote in message
...
No need for the call to INDEX.

=CHOOSE(INT((MONTH(A1)+2)/3),90+(DAY(DATE(YEAR(A1),2,29))=29),91,92,92)

--
Biff
Microsoft Excel MVP


"Peo Sjoblom" wrote in message
...
One way

=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),IF(DAY(DATE(YEAR(A1),2,29))=29,91,90),91,92,92 )

will take care of leap years as well

if only for 2007


=CHOOSE(INDEX({1;2;3;4},INT((MONTH(A1)+2)/3)),90,91,92,92)



--

Regards,

Peo Sjoblom

"Mahesh" wrote in message
...
Hi,
Is there any formula to count the number of days in the quarter.

e.g if I have a date Feb6, 2007 in one cell, I want to populate
corresponding cell with number of days in Q1 2007 (90 days).

Please help me in this.

Thanks,
Mahesh











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
COUNT how many ROWS ago out of 10 days that the highest high in 10 days was made rhhince Excel Worksheet Functions 1 January 14th 07 09:56 PM
count days Larry New Users to Excel 3 June 2nd 06 04:24 PM
Count # days Annette Excel Worksheet Functions 2 April 25th 06 09:01 PM
count down the days??? Ltat42a Excel Discussion (Misc queries) 2 October 26th 05 02:09 AM
Count of days Albert Excel Worksheet Functions 5 March 2nd 05 08:33 PM


All times are GMT +1. The time now is 02:40 AM.

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"