How would I look up the first value < 0 in this range and replace it with 0? If the value <0 does not exist, I'd like the column to remain intact. I've been struggling with this for a day now
Edit: I need only the first result less then zero (in this case only the first -90) to be set to 0.
Best Answer
Please try the following
(You can adjust ranges to your needs)
How the formula works:
We use the
QUERY
function to find all negative values and limit the result to just the first found.Then the
IF
function returnsThis value
(or whatever you want) if true or the rest of the range if false.Functions used:
QUERY
ArrayFormula
IF