Skip to main content
Participant
November 13, 2018
Answered

Custom Calculation Help

  • November 13, 2018
  • 3 replies
  • 600 views

I need help converting the following equation (taken from my excel worksheet) to work in my form in Adobe DC:

SUM(D13:D15)/15*C13

This topic has been closed for replies.
Correct answer George_Johnson

It could be something like:

// Get the field values, as numbers

var D13 = +getField("D13").value;

var D14 = +getField("D14").value;

var D15 = +getField("D15").value;

var C13 = +getField("C13").value;

// Perform the calculation and set this value

event.value = (D13 + D14 + D15) / 15 * C13

Replace "D13" etc. in the statements that use getField with the actual field names.

If using the simplified field notation option, it would be:

(D13 + D14 + D15) / 15 * C13

but again you'd use the actual field names. If the field names have spaces, punctuation, or certain other non-alphanumeric characters, you have to escape each such character with a backslash when using this option.

3 replies

Participant
November 14, 2018

Thank you so  much! Worked perfectly!

George_JohnsonCorrect answer
Inspiring
November 13, 2018

It could be something like:

// Get the field values, as numbers

var D13 = +getField("D13").value;

var D14 = +getField("D14").value;

var D15 = +getField("D15").value;

var C13 = +getField("C13").value;

// Perform the calculation and set this value

event.value = (D13 + D14 + D15) / 15 * C13

Replace "D13" etc. in the statements that use getField with the actual field names.

If using the simplified field notation option, it would be:

(D13 + D14 + D15) / 15 * C13

but again you'd use the actual field names. If the field names have spaces, punctuation, or certain other non-alphanumeric characters, you have to escape each such character with a backslash when using this option.

try67
Community Expert
Community Expert
November 13, 2018