Convert -ve numbers to zero when averaging in Excel -


how convert -ve numbers 0 when writing average function in excel?

i have column mix of +ve , -ve values , -ve values converted +ve when run average function.

this context of doing far. ideally, prefer situation not involve vba usage.

=average(c:c)

to ignore negative numbers, use

=averageif(c:c,">0") 

to use zeros part of average, use:

=sumif(c:c,">0")/count(c:c) 

where c:c range average (from given example).


to echo grandocu's suggestion, stdev, can use array formula:

=stdev.p(if(c:c>0,c:c,0)) 

depending on how many records you're focusing on, possibly suggest creating new column values related original date. i.e. if have column c:c positive , negative values, enter column d:d formula so:

=if(c2>0,c2,0) 

then, run averages/stdev calculations on column d instead. keep having use complicated/less common formulas, , visually may make things easier understand when looking @ datasheet.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -