Sorry, just got back from a meeting... So, you only need to use the first example from the wiki since you only need to compare 2 values < input type = "number" name = "attr_min_xy" value = "(((@{x} + @{y}) - abs(@{x} - @{y})) / 2)" disabled > Just substitute your formula for X and use "99" for Y. <input type="hidden" name="attr_min_xy" value="(((( floor(1+(@{intF}*0.5)+(@{lvlF}*0.5)+(@{emp6a}+@{emp6b}+@{emp6c}+@{emp6d}+@{emp6e}+@{emp6f})) ) + 99) - abs(( floor(1+(@{intF}*0.5)+(@{lvlF}*0.5)+(@{emp6a}+@{emp6b}+@{emp6c}+@{emp6d}+@{emp6e}+@{emp6f})) ) - 99)) / 2)" disabled> Now you should have an attribute you can use (If x > y, the result is y, while if x < y, the result is x.) Just rename "attr_min_xy" in the example above to "attr_ mmpF ". Untested, but I think that should solve your problem. edit: changed the example from type="hidden" to type="number" so you can see the result.