Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tom
 
Posts: n/a
Default Averaging with zeros NOT

{=AVERAGE(IF(Prov!$A$2:$A$2978=$A2,Prov!$R$2:$R$29 78))}

Above is a formula that succesfully averages what I want. However
sometime the Prov!range r2:R2978 contains zeros.

How can I eliminate those zeros from the average?

The first part of the formula with the cell reference is looking up and
match a name before performin the average..

TIA

Tom

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=AVERAGE(IF((Prov!$A$2:$A$2978=$A2)*(Prov!$R$2:$R$ 2978<0),Prov!$R$2:$R$2978
))

still an array formula

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Tom" wrote in message
ups.com...
{=AVERAGE(IF(Prov!$A$2:$A$2978=$A2,Prov!$R$2:$R$29 78))}

Above is a formula that succesfully averages what I want. However
sometime the Prov!range r2:R2978 contains zeros.

How can I eliminate those zeros from the average?

The first part of the formula with the cell reference is looking up and
match a name before performin the average..

TIA

Tom



  #3   Report Post  
DaveB
 
Posts: n/a
Default

Add another if statement right before you do the average:
=AVERAGE(IF(Prov!$A$2:$A$2978=$A2,IF(Prov!$R$2:$R$ 2978=0,"",Prov!$R$2:$R$2978),""))

--
Regards,

Dave


"Tom" wrote:

{=AVERAGE(IF(Prov!$A$2:$A$2978=$A2,Prov!$R$2:$R$29 78))}

Above is a formula that succesfully averages what I want. However
sometime the Prov!range r2:R2978 contains zeros.

How can I eliminate those zeros from the average?

The first part of the formula with the cell reference is looking up and
match a name before performin the average..

TIA

Tom


  #4   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

Array entered:

=AVERAGE(IF((Prov!$A$2:$A$2978=$A2)*(Prov!$R$2:$R$ 2978<0),Prov!$R$2:$R$2978))

Biff

"Tom" wrote in message
ups.com...
{=AVERAGE(IF(Prov!$A$2:$A$2978=$A2,Prov!$R$2:$R$29 78))}

Above is a formula that succesfully averages what I want. However
sometime the Prov!range r2:R2978 contains zeros.

How can I eliminate those zeros from the average?

The first part of the formula with the cell reference is looking up and
match a name before performin the average..

TIA

Tom



  #5   Report Post  
Excel_Geek
 
Posts: n/a
Default


You could create another column of data that read's the column you wish
to average like this {=if(A2=0,"",A2). This will effectively replace
the zeros with blanks, which are not included as zero values in an
average. Then you can change the column you wish to average with the
new column.

There'd be a myriad of more complicated and VBA-involved solutions, but
this is quick and easy.


--
Excel_Geek
------------------------------------------------------------------------
Excel_Geek's Profile: http://www.excelforum.com/member.php...o&userid=26423
View this thread: http://www.excelforum.com/showthread...hreadid=396927



  #6   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Tom,

=SUMIF(A2:A2978,A2,R2:R2978)/SUMPRODUCT((A2:A2978=A2)*(R2:R2978<0))

Array-entering not necessary.
--
Earl Kiosterud
www.smokeylake.com

"Tom" wrote in message
ups.com...
{=AVERAGE(IF(Prov!$A$2:$A$2978=$A2,Prov!$R$2:$R$29 78))}

Above is a formula that succesfully averages what I want. However
sometime the Prov!range r2:R2978 contains zeros.

How can I eliminate those zeros from the average?

The first part of the formula with the cell reference is looking up and
match a name before performin the average..

TIA

Tom



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
CSV File - Leading Zeros Floridagal Excel Discussion (Misc queries) 2 August 6th 05 12:34 AM
Creating formulas that allow the solutions to start with zeros. mevans Excel Discussion (Misc queries) 2 July 20th 05 05:00 PM
How do I force leading zeros in an Excel cell? EricKei Excel Discussion (Misc queries) 2 June 15th 05 08:28 PM
Averaging noncontiguous numbers ignoring zeros? Mike Excel Worksheet Functions 19 March 4th 05 02:05 AM
Averaging, ignoring zeros Mark Excel Worksheet Functions 5 February 28th 05 10:25 PM


All times are GMT +1. The time now is 05:56 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"