MONTH INCREMENT FORMULA

D

deepak bsg

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.
 
O

OssieMac

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
 
T

Toppers

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top