Conditional logic formulas for variable number input?