2 Replies Latest reply on Mar 9, 2015 9:12 AM by peru22044

# Could someone please translate this excel formula into javascript for a form  =SUM((G7*13),H7)  i can't seem to figure it out

i have to calculate fields for a total where it is a field times 13 plus another field for the grand total, help is greatly appreciated!

• ###### 1. Re: Could someone please translate this excel formula into javascript for a form  =SUM((G7*13),H7)  i can't seem to figure it out

The simplified field notation option could be:

G7 * 13 + H7

But replace "G7" and "H7" with the actual field names. If the field names include spaces or other punctuation, you'll have to escape each such character with a \ character.

The custom calculation JavaScript could be:

(function () {

// Get the field values, as numbers

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

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

// Perform calculation and set this field's value

event.value = G7 * 13 + H7;

})();

Again, use the actual field names in place of "G7" and "H7" above.

• ###### 2. Re: Could someone please translate this excel formula into javascript for a form  =SUM((G7*13),H7)  i can't seem to figure it out

got it. you're awesome, thank you!