Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
My button contains month & year (i.e., apr-07,may-07....mar-08). If i
select a particular month in the button (eg: Aug-07). I should get the total no.of months starting from apr-07 to aug-07 i.e., 5 months. Hence i require a formula to get the total no of months as explained above. With the help of your fomula i'll extract the data from another sheet. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Deepak,
Try this and see if it meets your requirements:- =MONTH("aug 2007")-MONTH("apr 2007")+1 I included the +1 because your result of 5 in your request indicated that you probably want to include both the months. The same function can be used on a worksheet and in VBA code. Regards, OssieMac "deepak bsg" wrote: My button contains month & year (i.e., apr-07,may-07....mar-08). If i select a particular month in the button (eg: Aug-07). I should get the total no.of months starting from apr-07 to aug-07 i.e., 5 months. Hence i require a formula to get the total no of months as explained above. With the help of your fomula i'll extract the data from another sheet. Thanks in advance. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Assuming the data is text i.e. the caption on the button [FORMS/CONTROL
toolbox?], then one way: Create table as below which I called "MyMonths" Apr 1 May 2 Jun 3 Jul 4 Aug 5 Sep 6 Oct 7 Nov 8 Dec 9 Jan 10 Feb 11 Mar 12 then formula is: =VLOOKUP(LEFT(A1,3),MyMonths,2,0) where A1 is your button text. "deepak bsg" wrote: My button contains month & year (i.e., apr-07,may-07....mar-08). If i select a particular month in the button (eg: Aug-07). I should get the total no.of months starting from apr-07 to aug-07 i.e., 5 months. Hence i require a formula to get the total no of months as explained above. With the help of your fomula i'll extract the data from another sheet. Thanks in advance. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks for your prompt reply. It is working.
Thankyou very much. "OssieMac" wrote: Hi Deepak, Try this and see if it meets your requirements:- =MONTH("aug 2007")-MONTH("apr 2007")+1 I included the +1 because your result of 5 in your request indicated that you probably want to include both the months. The same function can be used on a worksheet and in VBA code. Regards, OssieMac "deepak bsg" wrote: My button contains month & year (i.e., apr-07,may-07....mar-08). If i select a particular month in the button (eg: Aug-07). I should get the total no.of months starting from apr-07 to aug-07 i.e., 5 months. Hence i require a formula to get the total no of months as explained above. With the help of your fomula i'll extract the data from another sheet. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Increment formula for time | Excel Discussion (Misc queries) | |||
how do i do this - increment month by 1 | Excel Worksheet Functions | |||
Excel formula to increment the month by 2? | New Users to Excel | |||
Excel formula to increment the month by 2? | Excel Worksheet Functions | |||
How do I increment a formula? | Excel Worksheet Functions |