#1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 921
Default Average

Hi all,

I need to calculate the average of b3:b9 if the month in a3:a9 is equal to
the month in a1, can anyone help me? The answer is 180 but I don't know how
to write the formula.

A B
2/14/2009
Date 8
2/1/2009 100.00%
1/31/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009
2/1/2009 500.00%

Thanks so much in advance.



  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,346
Default Average

Hi,

In 2007

=AVERAGEIF(B3:B9,A3:A9,A1)

In 2003

=AVERAGE(IF(A3:A9=A1,B3:B9,""))

This second formula is an array and must be entered by pressing
Shift+Ctrl+Enter.


--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Jeff" wrote:

Hi all,

I need to calculate the average of b3:b9 if the month in a3:a9 is equal to
the month in a1, can anyone help me? The answer is 180 but I don't know how
to write the formula.

A B
2/14/2009
Date 8
2/1/2009 100.00%
1/31/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009
2/1/2009 500.00%

Thanks so much in advance.



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Average

Try one of these array formulas** :

=AVERAGE(IF(MONTH(A3:A9)=MONTH(A1),B3:B9))

Based on your data the result is 150%. It's including the empty cell that
corresponds to 2/1/2009 and evaluating it as 0. If you want to exclude the
empty cell:

=AVERAGE(IF((MONTH(A3:A9)=MONTH(A1))*(B3:B9<""),B 3:B9))

This one returns 180%

Format as Percentage

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Jeff" wrote in message
...
Hi all,

I need to calculate the average of b3:b9 if the month in a3:a9 is equal to
the month in a1, can anyone help me? The answer is 180 but I don't know
how
to write the formula.

A B
2/14/2009
Date 8
2/1/2009 100.00%
1/31/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009
2/1/2009 500.00%

Thanks so much in advance.





  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 921
Default Average

Thanks again for your help on this. However it did not work for the Month. I
did get the answer from another user.

"Shane Devenshire" wrote:

Hi,

In 2007

=AVERAGEIF(B3:B9,A3:A9,A1)

In 2003

=AVERAGE(IF(A3:A9=A1,B3:B9,""))

This second formula is an array and must be entered by pressing
Shift+Ctrl+Enter.


--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Jeff" wrote:

Hi all,

I need to calculate the average of b3:b9 if the month in a3:a9 is equal to
the month in a1, can anyone help me? The answer is 180 but I don't know how
to write the formula.

A B
2/14/2009
Date 8
2/1/2009 100.00%
1/31/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009
2/1/2009 500.00%

Thanks so much in advance.



  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 921
Default Average

Thanks so much!

"T. Valko" wrote:

Try one of these array formulas** :

=AVERAGE(IF(MONTH(A3:A9)=MONTH(A1),B3:B9))

Based on your data the result is 150%. It's including the empty cell that
corresponds to 2/1/2009 and evaluating it as 0. If you want to exclude the
empty cell:

=AVERAGE(IF((MONTH(A3:A9)=MONTH(A1))*(B3:B9<""),B 3:B9))

This one returns 180%

Format as Percentage

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Jeff" wrote in message
...
Hi all,

I need to calculate the average of b3:b9 if the month in a3:a9 is equal to
the month in a1, can anyone help me? The answer is 180 but I don't know
how
to write the formula.

A B
2/14/2009
Date 8
2/1/2009 100.00%
1/31/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009
2/1/2009 500.00%

Thanks so much in advance.








  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Average

You're welcome!

--
Biff
Microsoft Excel MVP


"Jeff" wrote in message
...
Thanks so much!

"T. Valko" wrote:

Try one of these array formulas** :

=AVERAGE(IF(MONTH(A3:A9)=MONTH(A1),B3:B9))

Based on your data the result is 150%. It's including the empty cell that
corresponds to 2/1/2009 and evaluating it as 0. If you want to exclude
the
empty cell:

=AVERAGE(IF((MONTH(A3:A9)=MONTH(A1))*(B3:B9<""),B 3:B9))

This one returns 180%

Format as Percentage

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Jeff" wrote in message
...
Hi all,

I need to calculate the average of b3:b9 if the month in a3:a9 is equal
to
the month in a1, can anyone help me? The answer is 180 but I don't know
how
to write the formula.

A B
2/14/2009
Date 8
2/1/2009 100.00%
1/31/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009 100.00%
2/1/2009
2/1/2009 500.00%

Thanks so much 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
A formula to AVERAGE IF but only average a set number of values [email protected] Excel Worksheet Functions 2 January 31st 08 08:28 PM
Find monthly average but have average automatically configured kimbafred Excel Discussion (Misc queries) 2 August 8th 07 12:28 AM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM
Weighed Average of a weiged average when there are blanks krl - ExcelForums.com Excel Discussion (Misc queries) 1 July 6th 05 07:37 PM
how does one convert text to a formula "average(A:A)" to =average( phshirk Excel Worksheet Functions 4 April 14th 05 01:20 AM


All times are GMT +1. The time now is 06:31 PM.

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"