#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default AVERAGE

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default AVERAGE

Done in a slightly different way.

=SUM(A2,A3,A4,A7)/COUNTIF(A2:A4,"0")+COUNTIF(A7,"0")

Mike

"sonicscooter" wrote:

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default AVERAGE

Sorry a set of brackets missing.

=SUM(A2,A3,A4,A7)/(COUNTIF(A2:A4,"0")+COUNTIF(A7,"0"))

Mike

"sonicscooter" wrote:

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default AVERAGE

Are A2:A4 always filled in with a number?

=SUM(A2:A4,A7)/(COUNTIF(A2:A4,"<"&0)+COUNT(A7))



sonicscooter wrote:

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default AVERAGE

Or if you could have text in those cells:

=SUM(A2:A4,A7)/(COUNTIF(A2:A4,"<"&0)+COUNTIF(A2:A4,""&0)
+(ISNUMBER(A7)*(A7<0)))

I missed the part that A7 should be excluded if =0 in the earlier post.



Dave Peterson wrote:

Are A2:A4 always filled in with a number?

=SUM(A2:A4,A7)/(COUNTIF(A2:A4,"<"&0)+COUNT(A7))

sonicscooter wrote:

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default AVERAGE

Hi,the list of cells is longer than that in my example,ie A1:A200 plus B2,the
reason for using an array formula was because some of the cells in either
A1:A200 or B2 may contain zero's.....i didn't want to count zero's as it
alters the outcome....Thanks Shane......England

"Dave Peterson" wrote:

Are A2:A4 always filled in with a number?

=SUM(A2:A4,A7)/(COUNTIF(A2:A4,"<"&0)+COUNT(A7))



sonicscooter wrote:

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default AVERAGE

It works fine,thanks very much....Shane.

"sonicscooter" wrote:

I understand the basics of array formulas,and the following formula
=AVERAGE(IF(A2:A4<0, A2:A4,"")) which doesn't count zero's,but i want the
cells A2:A4 but also with A7 added as a seperate cell for the formula to use
in its calculations =AVERAGE(A2:A4,A7) something like this
=AVERAGE(IF(A2:A4,A7<0, A2:A4,A7,"")) although this doesn't work,does
anyone know how to write this the right way..........Help please...

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 doesn't average correctly? jmj713 Excel Discussion (Misc queries) 4 October 24th 06 06:16 PM
average cells, show 0 if nothing to average Kycajun Excel Discussion (Misc queries) 8 June 21st 06 07:36 PM
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 04:28 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"