Converting Excel Formula to Java Script
I'm trying to convert a formula from my excel spread sheet to java script please help. I wonder if it has something to do with the LN() excel function. Based on my research Math.log is equal to LN() function in adobe.
This is the native excel formula:
=((9/5)*(((237.3*(LN(((6.108*(2.718281828^((17.27*((5/9)*(B26-32)))/(237.3+((5/9)*(B26-32))))))-(0.00066*(1+0.00115*((5/9)*(B26-32)))*(((5/9)*(C26-32))-((5/9)*(B26-32)))*1013))/6.108)/17.27))/(1-(LN(((6.108*(2.718281828^((17.27*((5/9)*(B26-32)))/(237.3+((5/9)*(B26-32))))))-(0.00066*(1+0.00115*((5/9)*(B26-32)))*(((5/9)*(C26-32))-((5/9)*(B26-32)))*1013))/6.108)/17.27)))))+32
This is the excel formula with the cell references replaced with Field Names in adobe:
=((9/5)*(((237.3*(LN(((6.108*(2.718281828^((17.27*((5/9)*(WetBulbTempFRow1-32)))/(237.3+((5/9)*(WetBulbTempFRow1-32))))))-(0.00066*(1+0.00115*((5/9)*(WetBulbTempFRow1-32)))*(((5/9)*(AmbientTempFRow1-32))-((5/9)*(AmbientTempFRow1-32)))*1013))/6.108)/17.27))/(1-(LN(((6.108*(2.718281828^((17.27*((5/9)*(WetBulbTempFRow1-32)))/(237.3+((5/9)*(AmbientTempFRow1-32))))))-(0.00066*(1+0.00115*((5/9)*(WetBulbTempFRow1-32)))*(((5/9)*(AmbientTempFRow1-32))-((5/9)*(WetBulbTempFRow1-32)))*1013))/6.108)/17.27)))))+32
If the ambient temp is 72 F and the wet bulb temp is 55 F the answer should be 40 F.
The only way i could get the formula to calculate something in adobe is by changing the LN to math.log in adobe but Its calculating the wrong number. The result ends up being 47 F instead of 40 F.
The adobe formula that is not working.
((9/5)*(((237.3*(math.log(((6.108*(2.718281828^((17.27*((5/9)*(this.getField("WetBulbTempFRow1").value-32)))/(237.3+((5/9)*(this.getField("WetBulbTempFRow1").value-32))))))-(0.00066*(1+0.00115*((5/9)*(this.getField("WetBulbTempFRow1").value-32)))*(((5/9)*(this.getField("AmbientTempFRow1").value-32))-((5/9)*(this.getField("WetBulbTempFRow1").value-32)))*1013))/6.108)/17.27))/(1-(math.log(((6.108*(2.718281828^((17.27*((5/9)*(this.getField("WetBulbTempFRow1").value-32)))/(237.3+((5/9)*(this.getField("WetBulbTempFRow1").value-32))))))-(0.00066*(1+0.00115*((5/9)*(this.getField("WetBulbTempFRow1").value-32)))*(((5/9)*(this.getField("AmbientTempFRow1").value-32))-((5/9)*(this.getField("WetBulbTempFRow1").value-32)))*1013))/6.108)/17.27)))))+32
PLEASE HELP
