I am trying to create a formula for a scorecard where bonus points are calculated.
I need the formula to look as to which of the scores below is greater, and the greater of the two scores returns a value of 3 bonus points.
The lower of the two scores returns a value of 0.
- HTP (Home Team Points) 147
- ATP (Away Team Points) 148
ANSWER:
- HTBP (Home Team Bonus Points) = 0
- ATBP (Away Team Bonus Points) = 3
I tried this but it doesn’t return any values at all.
var HTP = Number(this.getField("HTP").valueAsString);
var ATP = Number(this.getField("ATP").valueAsString);
this.getField("HTBP").value = (HTBP&&ATBP) ? (HTP > ATP ? 3:0) : "";
this.getField("ATA").value = (HTBP&&ATBP) ? (HTP > ATP ? 0:3) : "";
New contributor
Phil is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2