A less advanced approach would be to use the operator reference to choose the operation carried out within an expression, rather than use it directly
= N( IF( operator=">", previous>value, previous<value ) )
This could either be a named formula 'testArray' or could be built directly into the final worksheet formula
= MMULT( test_array, {1;1;1} )
= MMULT( N( IF( operator=">", previous>value, previous<value ) ), {1;1;1} )