• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Want to retrive the months between the input values?????

Dear All,


I have a 12 months, listed as Jan-12,Feb-12,Mar-12.......Dec-12.

When the i input the value in A1=Jan-12 & B1=Apr-12.

I want the list of months as Jan-12,Feb-12,Mar-12,Apr-12 in the following cells C1,C2,C3,C4.


If the input changes to Jul-12 --- Dec-12. It should bring the months between this months.


Kindly help me out!!!!!!!!!!!!!!!
 
Hi Suman,


check the undisclosed function by MS,


=datedif(1-1-12,1-12-12,"m")


also the Output is in Number format & not is date format


Try and let us know your feedback
 
Suman


Firstly, Welcome to the Chandoo.org Forums


Do you want Nagesh's solution or try the following


In C1:
Code:
=EOMONTH(B1,0)+1

In C2: =EOMONTH(C1,0)+1

Copy C2 down
 
Making the assumption that your list of 12 months is in D1:D12, array formula in C1 is:

=IF(MONTH($B$1)-MONTH($A$1)+1<ROWS(C$1:C1),"",INDEX(D:D,SMALL(IF((MONTH($D$1:$D$12)>=MONTH($A$1))*(MONTH($D$1:$D$12)<=MONTH($B$1)),ROW($D$1:$D$12)),ROW($A1))))


Copy the formula down to C12. Note that array formulas need to be confirmed using Ctrl+Shift+Enter, not just Enter.
 
Back
Top