Skip to main content
Participant
February 16, 2018
Answered

Looking for formula help!!

  • February 16, 2018
  • 1 reply
  • 551 views

So this might be a dumb and simple question but I am attempting to have a letter grade out put based on the results of a different box.

I have a text field that adds together two other fields on the form. (Lets call it Total point demerits) I need a different box (lets call it inspection grade) to out put a letter based on the data from box 1


If total point demerits is <= 10 then inspection grade should be AIf total point demerits is >= 11 &&  <= 20 then inspection grade should be B

If total point demerits is >= 21 && <= 40 then inspection grade should be C

Thank you for your help.

This topic has been closed for replies.
Correct answer try67

As the custom calculation script of "inspection grade" enter this code:

var points = Number(this.getField("Total point demerits").valueAsString);

if (points<=10) event.value = "A";

else if (points<=20) event.value = "B";

else if (points<=40) event.value = "C";

I wasn't sure what you wanted to do if the total is zero, or if the field is empty...

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 16, 2018

As the custom calculation script of "inspection grade" enter this code:

var points = Number(this.getField("Total point demerits").valueAsString);

if (points<=10) event.value = "A";

else if (points<=20) event.value = "B";

else if (points<=40) event.value = "C";

I wasn't sure what you wanted to do if the total is zero, or if the field is empty...