ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   function for average without zero (https://www.excelbanter.com/excel-worksheet-functions/39502-function-average-without-zero.html)

kml

function for average without zero
 
Hi

I'd like to create a function that would calculate the average without the
zero(s)?

Thanks in advance.

kml

Gary's Student

There are two solutions:

1. replace the zeros with blanks. AVERAGE will ignore blanks

2. use SUMIF() divided by COUNTIF() excluding zeros in each of the functions
--
Gary's Student


"kml" wrote:

Hi

I'd like to create a function that would calculate the average without the
zero(s)?

Thanks in advance.

kml


Aladin Akyurek

=SUM(A3:A10)/COUNTIF(A3:A10,"0")

kml wrote:
Hi

I'd like to create a function that would calculate the average without the
zero(s)?

Thanks in advance.

kml


[email protected]

=average(if((A1:A10<0,A1:A10,"")
array entered (ctl, shift, enter)

should do what you need

hth RES



All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com