Forum Discussion
Logical function (AND, OR) in Dynamic Array/Spilled Range
Hello,
I have a spilled function, (lets say in C1 I use SORT(B1:B10)) and I need to know if each cell in the spilled range is in the between a max value and min value, so I need the returned product to be also a spilled range.
Let's say the max value is 7000 and min value is 3000, and I used the following function in cell D1:
=IF(AND(C1#>=3000;C1#<=7000);"NORMAL";"ABNORMAL")
I expect it to return it as a spilled range and fills D1 to D10, but it only returned the first row of the dynamic array. The returned product only fills D1 as "NORMAL" while D2 - D10 remains empty; it didn't return a spilled product.
I tried to experiment with it, trying if the problem is in the IF function or in the AND function. I tried to do the IF and AND function separately on a spilled range, and it turned out the problem is with the AND function (the IF function returned a spilled range, while the AND only returned a single cell).
I need the IF and AND function to return a spilled range product. Can someone help?
Thank you in advance.
6 Replies
- SergeiBaklanDiamond Contributor
In general, it's better to avoid AND() and OR() and use * and + instead.
- Patrick2788Silver Contributor
Try this one:
=IF((C1#>=3000)*(C1#<=7000),"Normal","Abnormal")
- JalessaIron Contributor
Yes I experienced the same issue, I noticed I had to return a spilled array of results, so I used the element-wise logical operations with the * ( for AND) or + ( for OR ) operators.
- lastcynics98Copper Contributor
That works, thanks a lot!!
- Patrick2788Silver Contributor
Glad it worked. You're welcome!
- Riny_van_EekelenPlatinum Contributor
Try this:
=IF(BYROW(C1#;LAMBDA(a;AND(a>3000;a<7000)));"Normal";"Abnormal")