Hi:
As for point 2 - it's already there array my_arr
is loaded with values from B2 to Dn, where n is last filled row
it's like you select D1048576 and press Ctrl+UpArrow
Try it. select D1048576 and press Ctrl+UpArrow. As you can see with your file - selection is now D57 - last filled cell in column D.
Point 1 does not matter: there are zeros or positive values in columns B and C. and if Bx is 0 then Cx is also 0. So while looping there will never be situation that Cy>Bx>By for any y because there is no By <0. (every Bi is >=0). Also there will be no Cx>By>Bx because with Bx = 0 Cx is also = 0 so there will be no value whic could be bigger than 0 and smaller than 0.
Point 3 is easy, but only once there is data which fulfills requirement
But your data do not.
The code could be:
But ... there is no data fulfilling the requirement. Please have a look on your data and judge yourself - which rows/units should be included. The code finds no such cases when
Cj>Bi>Bj
Even if we allow i<j (we do not - as per request) there is no match.
I'd say points 1 and 3 are simple mathematics. We cannot change it
Bookmarks