Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with Greater Than Formula in Acrobat Pro

New Here ,
Jan 24, 2024 Jan 24, 2024
Hi everyone I need help with a simple formula for a score card. I need the formula to look at two scores, so H1 and A1. The greater of the two scores results to be awarded 1 point in the Home Reward / Away Reward columns. So for example below , the home player below scored 50 points. Away player scored 60 points. Away player gets rewarded with 1 point, whereas home player gets 0 reward. So whomever outscores their opponets gets 1 point for the win. But I also need to show that the opponent who lost the game gets 0. Home Player Home Points Home Reward Away Player Away Points Away Reward Home Name 50 (H1) 0 Away Name 60 (A1) 1 What would be the formulas for the Home Reward Field and then the same for the Away Reward Field ? The results will wil never be equal, one opponent will aways outscore the other, so one will always be greater or less (never equal) to the other score if that helps. Any help would be most appreciated.
243
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2024 Jan 24, 2024
LATEST

You can use this as a custom calculation script in one of the fields (make sure field names in script are correct):

var h1 = Number(this.getField("H1").valueAsString);
var a1 = Number(this.getField("A1").valueAsString);
this.getField("Home Reward Field").value = (h1&&a1) ? (h1 > a1 ? 1:0) : "";
this.getField("Away Reward Field").value = (h1&&a1) ? (h1 > a1 ? 0:1) : "";

If you have more fields, it would be better to use loop to set all fields with one script, if you share your file or tell us how many fields you have and their names we can help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines