ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Handling #NUM! error (https://www.excelbanter.com/excel-worksheet-functions/132439-handling-num-error.html)

Michel Khennafi

Handling #NUM! error
 
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



Harlan Grove

Handling #NUM! error
 
"Michel Khennafi" wrote...
....
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,COUNTI F(C662:F662,"<=0")
+1),
"")



All times are GMT +1. The time now is 10:50 PM.

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