Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 46
Default Counting Months to get an Average

Hi Everyone

I have month columns with labels which start with April 2009 through March
2010.

I have another cell which indicates the current month.

If the current month is December,
I need a formula which looks at my columns and tells me that April to
December is 8 months.

If I am in January however, I need the formula to calculate 9 months.
(Most of the date functions obviously assume your first month is January (1)
and last month is December (12))

(Or if it doesn't look at the columns, that's fine too, but I figure that
will help somehow).
I am trying to create an average function but its a bit trickier than I
anticipated!
I have tried some If formulas but its a bit beyond me.

Hope I've explained that OK - happy new year to all!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Counting Months to get an Average

Maybe this will help

=DATEDIF(first_month_cell,check_cell,"M")

--
__________________________________
HTH

Bob

"LinLin" wrote in message
...
Hi Everyone

I have month columns with labels which start with April 2009 through March
2010.

I have another cell which indicates the current month.

If the current month is December,
I need a formula which looks at my columns and tells me that April to
December is 8 months.

If I am in January however, I need the formula to calculate 9 months.
(Most of the date functions obviously assume your first month is January
(1)
and last month is December (12))

(Or if it doesn't look at the columns, that's fine too, but I figure that
will help somehow).
I am trying to create an average function but it's a bit trickier than I
anticipated!
I have tried some If formulas but it's a bit beyond me.

Hope I've explained that OK - happy new year to all!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default Counting Months to get an Average

Hi,

If you enter the current month a label "December" and the entries in the
other column are really "labels" not dates then suppose the list of months
is in A1:A12 and the current month is entered in B1:

=MATCH(TRUE,ISNUMBER(FIND(C1,A1:A12)),0)-1

This is an array formula so you must enter it by pressing Shift+Ctrl+Enter

If the entries in A1:A12 are really dates then try this

=MATCH(G1,TEXT(A1:A12,"mmmm"),0)-1

This is also array entered.

If the entries in A1:A12 and December are dates then "maybe" you can use
DATEDIF:

=DATEDIF(A1,B1,"m")

But note that all dates must be entered as the same day of the month, why?
If A1 is 4/2/2008 and B1 is 12/1/2008 your answer will be one month off
because DATEDIF with "m" only counts whole months.



If this helps, please click the Yes button

Cheers,
Shane Devenshire

"LinLin" wrote in message
...
Hi Everyone

I have month columns with labels which start with April 2009 through March
2010.

I have another cell which indicates the current month.

If the current month is December,
I need a formula which looks at my columns and tells me that April to
December is 8 months.

If I am in January however, I need the formula to calculate 9 months.
(Most of the date functions obviously assume your first month is January
(1)
and last month is December (12))

(Or if it doesn't look at the columns, that's fine too, but I figure that
will help somehow).
I am trying to create an average function but its a bit trickier than I
anticipated!
I have tried some If formulas but its a bit beyond me.

Hope I've explained that OK - happy new year to all!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 46
Default Counting Months to get an Average

Thanks Shane and Bob - great responses.

(And sorry I think I created some confusion, December should have been "9"
not 8, I have amended the formulas where necessary, only the last formula
needed to be changed by adding +1 - apologies for that!)

Everything worked great, it will save a heap of time!

cheerio

"Shane Devenshire" wrote:

Hi,

If you enter the current month a label "December" and the entries in the
other column are really "labels" not dates then suppose the list of months
is in A1:A12 and the current month is entered in B1:

=MATCH(TRUE,ISNUMBER(FIND(C1,A1:A12)),0)-1

This is an array formula so you must enter it by pressing Shift+Ctrl+Enter

If the entries in A1:A12 are really dates then try this

=MATCH(G1,TEXT(A1:A12,"mmmm"),0)-1

This is also array entered.

If the entries in A1:A12 and December are dates then "maybe" you can use
DATEDIF:

=DATEDIF(A1,B1,"m")

But note that all dates must be entered as the same day of the month, why?
If A1 is 4/2/2008 and B1 is 12/1/2008 your answer will be one month off
because DATEDIF with "m" only counts whole months.



If this helps, please click the Yes button

Cheers,
Shane Devenshire

"LinLin" wrote in message
...
Hi Everyone

I have month columns with labels which start with April 2009 through March
2010.

I have another cell which indicates the current month.

If the current month is December,
I need a formula which looks at my columns and tells me that April to
December is 8 months.

If I am in January however, I need the formula to calculate 9 months.
(Most of the date functions obviously assume your first month is January
(1)
and last month is December (12))

(Or if it doesn't look at the columns, that's fine too, but I figure that
will help somehow).
I am trying to create an average function but its a bit trickier than I
anticipated!
I have tried some If formulas but its a bit beyond me.

Hope I've explained that OK - happy new year to all!



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
Average number of months shan88 Excel Worksheet Functions 1 May 27th 08 12:26 AM
Want average sales numbers for last 12 months. Pierre Excel Worksheet Functions 2 September 29th 06 07:16 PM
Counting Months jermsalerms Excel Worksheet Functions 4 June 5th 06 10:27 PM
Counting Months Farrel Excel Worksheet Functions 2 August 26th 05 06:51 PM
Counting months Aaron Howe Excel Worksheet Functions 5 July 11th 05 07:35 PM


All times are GMT +1. The time now is 12:37 AM.

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

About Us

"It's about Microsoft Excel"