There is an alternative solution, which is shorter and scales better if you will need 100 smallest instead of 10 smallest numbers:
=average(array_constrain(sort(D2:BD2), 10, 10))
Here, sort sorts the array in the increasing order. The array_constrain limits the output to at most 10 rows and 10 columns, which in practice means 10 smallest elements, regardless of whether your data was in a row or in a column.
Solved my own question, in a bit of a brute force method. Since Google sheets was a bit iffy about letting me do an AND statement on ISNUMBER(SEARCH()), I added 3 helper columns which I hid:
Column P=ISNUMBER(SEARCH("Cancelled",$O2)) *Checking for Cancelled on in a string TRUE/FALSE
Column Q=IF($P2=TRUE,1,0) *Returns 1 in any column with TRUE for Cancelled
Column R=$Q2+$B2 *Adds a 1 to any order number where the previous formula returns a 1
I then used =countif($R:$R,R2)>1 and applied it to column B.
Best Answer
In Google Sheets, you need to wrap
small
inarrayformula
so it produces an array:There is an alternative solution, which is shorter and scales better if you will need 100 smallest instead of 10 smallest numbers:
Here,
sort
sorts the array in the increasing order. Thearray_constrain
limits the output to at most 10 rows and 10 columns, which in practice means 10 smallest elements, regardless of whether your data was in a row or in a column.