Returning NULL when there are zeros present

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used the formula below, it works fine, but if there are zeros in the race
line it returns zero as the smallest number.

=SUM(SMALL(13:A4,{1,2})/2)

How can I write the formula so that if there is a zero it will return
null, and then do the computation.

Zetastrat
 
=SUM(SMALL(IF(A1:A10<>0,A1:A10),{1,2})/2)

OR

=AVERAGE(SMALL(IF(A1:A10<>0,A1:A10),{1,2}))

...both confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top