0
votes

I made this google script:

    function quadrato(input) {
      return POW(input,2);
    }

I entered a call to my "quadrato" function in a sheet, but the sheet gave me this error:

ReferenceError: "POW" non definito. (riga 2).

sheet calling my script function "quadrato"

Instead "POW" is a referenceable function from sheets, as you can see in this iimage:

1
You cannot use sheets functions inside apps script. - TheMaster
Thanks. That's a pity! - dario tempra
There are equivalents in JavaScript like Math.pow - TheMaster
I uset Math.pow but google sheet said to me: Errore ReferenceError: MATH is not defined (riga 2). - dario tempra
ok, i success with Math.pow. My problem is solved, thanks. - dario tempra

1 Answers

0
votes

Actually, you just need to declare your custom function:

Add /** ... */ statement in front of the function(){}

/**
 * Your description about this function.
 * @customfunction
 * @param {input} the description about this papameter
 */
function quadrato(input) {
  return Math.pow(input,2);
}