Reputation: 1
I have a simple excel formula I am trying to replicate in javascript but am a newbie and can't seem to get it to work!
Excel Formula:
=((D6*D7)/3.6)+(D7*D7)/(254*(D8+0.01*D9))
Java Script:
= (D6 * D7) / 3.6 + (D7 * D7) / (254 * (D8 + 0.01 * D9));
I appreciate any advice.
Upvotes: 0
Views: 185
Reputation: 1
Thanks Justin,
I already had the variables defined, I was just questioning the formula. After trial and error I found that the D8 addition was causing the problem. The final successful outcome was:
= ((D6 * D7) / 3.6) + (D7 * D7) / (254 * (0.01 * D9 + +D8))
Upvotes: 0
Reputation: 2795
you should define the value of D6, D7, D8 and D9 at first, like:
var D6 = 3;
var D7 = 5;
var D8 = 9;
var D9 = 10;
var result = (D6 * D7) / 3.6 + (D7 * D7) / (254 * (D8 + 0.01 * D9));
Upvotes: 1