Handling #NUM! error

M

Michel Khennafi

Good afternoon gurus,

I created a formula in a spreadsheet that returns the followin g error #NUM!

I have 4 zero values in C662:F662 and the formula I created in G662 is
=SMALL(C662:F662,COUNTIF(C662:F662,0)+1)

How could I modify the formula to avoid the #NUM! error display... I tried
the formula if(erro.type... in G662 but got no success!

Help is more than welcome

Be well

Thanks
 
H

Harlan Grove

Michel Khennafi said:
I have 4 zero values in C662:F662 and the formula I created in G662 is
=SMALL(C662:F662,COUNTIF(C662:F662,0)+1)

How could I modify the formula to avoid the #NUM! error display...

If the formula above returns #NUM! because there are only 4 cells in
this range, they're all zero, so the COUNTIF call returns 4, so the
2nd argument to SMALL is 5, and 5 exceeds the number of cells in
C662:F662. If you want the smallest positive number in that range or
"" if there aren't any, try

=IF(COUNTIF(C662:F662,">0"),SMALL(C662:F662,COUNTIF(C662:F662,"<=0")
+1),
"")
 

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

Top