How many Quarter between 2 dates?

RENU1973
Lounger
Posts: 26
Joined: 20 Jan 2014, 11:18
Location: nepal

How many Quarter between 2 dates?

Post by RENU1973 »

I want to know an excel formula to calculate the how many quarter falls between 2 dates?

Suppose,one date is 22/05/2013 and other date is 05/02/2014.Then the total quarter should be 4.

Quarter criteria should be:-
Jan~Mar
Apr~Jun
Jul~Sep
Oct~Dec

Date fall in the above range should count 1 Quarter.22/05/2013 falls in 'Apr~Jun' and 05/02/2014 falls in 'Jan~Mar,then,total Quarter are 4.

Can it be calculate through an excel formula?'
You do not have the required permissions to view the files attached to this post.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: How many Quarter between 2 dates?

Post by Rudi »

Attached...
Book1.xlsx
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: How many Quarter between 2 dates?

Post by Rudi »

As for your other question about VBA form, see if this works for you.
Age Calculator.xlsm
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
StuartR
Administrator
Posts: 12632
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: How many Quarter between 2 dates?

Post by StuartR »

Rudi,

Thanks for answering both questions in this thread. I was trying to decide whether to unlock the other one again when you resolved the issue anyway!
StuartR


RENU1973
Lounger
Posts: 26
Joined: 20 Jan 2014, 11:18
Location: nepal

Re: How many Quarter between 2 dates?

Post by RENU1973 »

Rudi Sir,in excel file attach by you,the formula is showing 2 quarter instead of 3 as I want.Have a look into the formula once again.

But Rudi sir,look into VBA Codes file ,in this file one date is 22/05/2013 and other is 05/02/2014 and the quarter should be 4 instead of 3 as per your solution.Request you to please look once again.The criteria should be Jan~Mar,Apr~Jun,Jul~Sep and Oct~Dec.Date first is falling into Apr~Jun and other date i.e.05/02/2014 is falling into Jan~Mar.Therefore,it should be 4.

Regards
Renu

User avatar
HansV
Administrator
Posts: 78657
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How many Quarter between 2 dates?

Post by HansV »

Does this do what you want?
Age Calculator.xlsm
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

RENU1973
Lounger
Posts: 26
Joined: 20 Jan 2014, 11:18
Location: nepal

Re: How many Quarter between 2 dates?

Post by RENU1973 »

Yes Hans that is the solution which I want.Thanks a lot for your effort.

Sir,request you to please suggest/amend an excel formula as attach by Mr.Rudi,that is not my requirement.

RENU1973
Lounger
Posts: 26
Joined: 20 Jan 2014, 11:18
Location: nepal

Re: How many Quarter between 2 dates?

Post by RENU1973 »

Hans Sir,sorry for the not looking proper text.Please correct the last text in your attach file of macro as 'Quarter'instead of 'Total Days'.

User avatar
HansV
Administrator
Posts: 78657
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How many Quarter between 2 dates?

Post by HansV »

In D5:

=DATEDIF(DATE(YEAR(B5), MONTH(B5)-MOD(MONTH(B5)-1,3),1),DATE(YEAR(C5), MONTH(C5)-MOD(MONTH(C5)-1,3),1),"m")/3+1

Excel may format the result as a date. Simply set the number format to General.
Fill down the formula as far as needed.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78657
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How many Quarter between 2 dates?

Post by HansV »

RENU1973 wrote:Hans Sir,sorry for the not looking proper text.Please correct the last text in your attach file of macro as 'Quarter'instead of 'Total Days'.
You can change the Caption property of the label yourself.
Best wishes,
Hans

RENU1973
Lounger
Posts: 26
Joined: 20 Jan 2014, 11:18
Location: nepal

Re: How many Quarter between 2 dates?

Post by RENU1973 »

Thank you Hans for both the reply.Now Glad to find the right solution.

Many-2 thanks to you once again.

Regards
Renu