I use this array formula:

=IF(ROWS($AV$1:$AV167)>$AU$41,"",INDEX(AS$44:AS$4001,SMALL(IF(ISNUMBER(MATCH($AS$44:$AS$4001,$K$23:$K$42,0)),ROW($AS$44:$AS$4001)),ROWS($AV$1:$AV167))-ROW($AS$44)+1))
It works, EXCEPT if the array range is not completely filled, all the cells in the final rows are expressed as #NUM!.

I am unable to "set" the number of rows, since the number of rows will vary depending on the amount of data I'm pulling into the array.

Since I have columns to the right of the array in which I do many additional calcs I either need to know how to do somethg like:

if(AB275 <> "#NUM!", AB275+AB274,0)
However the above doesn't work. (with or without the quotes).

Any ideas? If can self-limit the array fill-down, that would work but I don't know how to do this.

Thanks for any help

PS the reason I don't use PTs is due to the many additional calcs I perform in the columns to the right of the range.