Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default MONTH INCREMENT FORMULA

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default MONTH INCREMENT FORMULA

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default MONTH INCREMENT FORMULA

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default MONTH INCREMENT FORMULA

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
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
Increment formula for time Ltat42a Excel Discussion (Misc queries) 4 August 2nd 06 11:21 PM
how do i do this - increment month by 1 [email protected] Excel Worksheet Functions 1 March 30th 06 11:39 PM
Excel formula to increment the month by 2? thirumalairajan New Users to Excel 5 February 12th 06 12:20 AM
Excel formula to increment the month by 2? thirumalairajan Excel Worksheet Functions 2 February 10th 06 09:23 AM
How do I increment a formula? JICDB Excel Worksheet Functions 2 September 16th 05 06:53 PM


All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"