I am looking to create an excel formula that runs through an array, and returns N matching results. i.e. I would have this formula first in cell A1 (for example), and it would return the first matching result. When I drag it down to cells A2, A3, etc. it returns the 2nd and 3rd matching result respectively. I currently have a formula that does this much:
INDEX(Sheet2!$B$2:$B$10081,AGGREGATE(15,3,(Sheet2!$AA$2:$AA$10081="TRUE")/(Sheet2!$AA$2:$AA$10081="TRUE")*(ROW(Sheet2!$AA$2:$AA$10081)-ROW(Sheet2!$AA$1)),ROWS($R$73:R73)))) However, I am trying to use the OR function, so instead of just checking if a range of cells is TRUE or FALSE (this is currently done with helper cells/columns), I want to just be able to check the range for if it matches any of the following conditions:
- Cells whose value is over 999999
- Cells whose value is 0
- Cells whose value is negative (<0)
My attempt is below:
INDEX(Sheet2!$A$2:$A$10081,AGGREGATE(15,3,(OR(Sheet2!$B$2:$B$10081>999999,Sheet2!$B$2:$B$10081=0,Sheet2!$B$2:$B$10081<0))/(OR(Sheet2!$B$2:$B$10081>999999,Sheet2!$B$2:$B$10081=0,Sheet2!$B$2:$B$10081<0))*(ROW(Sheet2!$B$2:$B$10081)-ROW(Sheet2!$B$1)),ROWS($P$73:P73)))) This does not work however because the 3rd argument of aggregate() needs to be an array, and I used an OR function which evaluates as a boolean. With this being said I am not sure how to properly integrate an OR functions to check for the above 3 conditions.



