I have a value in a google sheet which is "test2".
Using Google apps script I have created a custom formula TE using the formula below.
I input the formula in the adjacent cell =TE(test2), the value it outputs is incorrect. In the script below, it keeps picking up test 1 value always as -125 and the if statements are not working.
Please can anyone help?
function TE(AL) {
var RH = -110;
var HF = -30;
var AC = '';
if (AL = "test1") {
AC = -125;
} else if (AL = "test2") {
AC = -135;
} else {
AC = -100000;
}
var TC = RH + HF + AC;
Logger.log (TC);
return TC;
}
==
forAL = "test1"
stackoverflow.com/questions/20404002/… – The fourth bird