Skip to main content
Best answer by Werner_E

In case you need it more often to limit a value or a vector of values between two limits, you may use a small utility function.

Werner_E_2-1753900087490.png

 

In your case you have to use vectorization and use the limits zero and infinity.

Werner_E_1-1753899829564.png

In case you use units, don't forget to apply the appropriate units to the limits as well (even if its infinity).

 

Of course you always can use programming (even thought it may be considered overkill here

Werner_E_4-1753900326176.png

And even though I don't like this kind of approach, what you can do with for loops most often also could be done using range variables:

Werner_E_5-1753900557716.png

 

Prime 9 sheet attached

 

 

 

 

2 replies

19-Tanzanite
July 30, 2025

Here's one way:

 

Pos.png

SFares14-AlexandriteAuthor
14-Alexandrite
August 2, 2025

Thank you, Alan!

Werner_E25-Diamond IAnswer
25-Diamond I
July 30, 2025

In case you need it more often to limit a value or a vector of values between two limits, you may use a small utility function.

Werner_E_2-1753900087490.png

 

In your case you have to use vectorization and use the limits zero and infinity.

Werner_E_1-1753899829564.png

In case you use units, don't forget to apply the appropriate units to the limits as well (even if its infinity).

 

Of course you always can use programming (even thought it may be considered overkill here

Werner_E_4-1753900326176.png

And even though I don't like this kind of approach, what you can do with for loops most often also could be done using range variables:

Werner_E_5-1753900557716.png

 

Prime 9 sheet attached

 

 

 

 

SFares14-AlexandriteAuthor
14-Alexandrite
August 2, 2025

Thank you for the different alternatives. Werner!

I used your solution.