0

The following formula returns the correct result:

=if(S3,if(J3>=NRealGames,0,min(max(NRealGames-J3,0),S3)/S3),)

This one returns the same result:

=if(S3:S,if(J3:J>=NRealGames,0,min(max(NRealGames-J3:J,0),S3:S)/S3:S),)

But this one returns the wrong result:

=ArrayFormula(if(S3:S,if(J3:J>=NRealGames,0,min(max(NRealGames-J3:J,0),S3:S)/S3:S),))

What is wrong with my ArrayFormula?

EDIT

This question is not duplicated of this because I am asking about ArrayFormula, not about Clamp (why was it marked as duplicated??)

  • 1
    The problem is that min and max, when given an array, just take the minimum (or maximum) of that array. They cannot be combined with arrayformula in order to "clamp" each value of an array within a range. – user79865 Aug 16 '15 at 20:51
  • @NormalHuman Thanks. If you post an answer I will accept it. – stenci Aug 17 '15 at 0:43