Home » excel » Handling errors for "Small" function in excel, when the length of array is less than the array provided

Handling errors for "Small" function in excel, when the length of array is less than the array provided

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am trying to consider only the least few in an array of some X number’s, i am getting #NUM! error when the function cannot find the length specified.

Example- Small(range,{1,2,3})
here the range of cells that contain numeric value is “range” and {1,2,3} is the 3 smallest number to be considered, what happens if the range has only 2 digits instead of 10.

Any advises will be helpful.
I was expecting a solution where the number can be made adjusted from the numerics available.

Here is the best example i can give

Please refer this image for exactly what i am doing

For Ron Rosenfeld reference

How to&Answers:

You can use IFERROR

=SUM(IFERROR(SMALL(A7:E7,{1,2,3}),""))

enter image description here

Answer:

Instead of array entering the formula over three cells, put this in the first cell and copy down three:

=IFERROR(SMALL(range,ROW(ZZ1),"")

Now it will not show the #NUM error if there are less than 3 items in the range

Answer:

Try:

=SMALL(range,ROW(INDIRECT("1:"&MIN(COUNT(range),3))))