Skip to main content
Participating Frequently
August 26, 2022
Question

Help with Formula

  • August 26, 2022
  • 1 reply
  • 1494 views

Help please.

I have a sheet where I want to calculate all the fields from 1 to 22 but not include the ones that have the zeros (=N/A).  then also have the zeros (n/a) = 4 to be deducted by total points of 88

do that number would be the dividend

 

Scores in the field range from 1 to 4 and 0 or N/A if they did not meet that criteria.

 

I also want to get the grade of the criterias were scored on

 

This topic has been closed for replies.

1 reply

Karl Heinz  Kremer
Community Expert
Community Expert
August 26, 2022

I don't think we have enough information to create a script for you, but it also sounds like the script would be a bit too complex for something that could be posted as part of a reply here.

 

Have you tried to create the script yourself? If so, what do you have currently? Based on the information we have, it sounds like you need to create a JavaScript. If you are new to JavaScript, it can be a daunting task to get started. I did write up some information about how to get started with scripting for Acrobat: http://khkonsulting.com/2017/01/learning-to-program-javascript-for-adobe-acrobat/

 

If this still sounds a bit too complex, you may want to reach out to somebody who can write such a script for you (and no, I am not currently taking on any new projects). 

 

CCamachoAuthor
Participating Frequently
August 29, 2022

Hi Karl

Let me explain a little

I have fields SS0 to SS21 with dropdown to select 0, 1, 2, 3, 4

This is what I want

There are 22 criteria and each criterion can have a maximum point of 4 points, therefore, 22 X 4 = 88
Maximum points may vary depending on the total number of criteria addressed during the evaluation. If criteria is not evaluated, enter “N/A” and these will be deducted from the maximum points.
To compute the student’s grade:
Total points received (excluding N/A) / Maximum points possible 88 X 100 = % grade
Example: Student received 80 points (had 2 N/A) / 88 X 100 = 90.9%

This is what I currently have. I keep getting zero. Your help is appreciated.

var nCount = 0;

var nSum = 0;

var na = 0;

event.value = 0;

for( var i=1; i<=6; i++){

if(this.getField("SS0"+i).valueAsString == "N/A"){

na++;

if(na == 6)

event.value = "N/A";}

else if(this.getField("SS0"+i).valueAsString != "N/A" && this.getField("SS0"+i).valueAsString != "" && this.getField("SS0"+i).valueAsString != 0){

nCount++;

nSum += Number(this.getField("SS0"+i).value);

event.value = nSum/nCount;}}

CCamachoAuthor
Participating Frequently
August 29, 2022

Sorry the selection in dropdow is 1,2,3,4 and N/A