I’ve created a custom google spreadsheet function via the script editor that calculates pace. I call the function in my spreadsheet via
=pace(00:33:00,10,km)
and the logic for the function is
function pace(time, dist, unit)
{
return pace(time.getHours(),time.getMinutes(),time.getSeconds(), dist, unit);
}
function pace(hrs,mins,secs,dist,unit)
{
var d = dist;
if(unit=="m"||unit="M")
d = dist*1.609344;
var minutes = 60*hrs+mins+secs/60.0;
var pace = minutes/d;
return pace;
}
but when the function is executed all i get is
error: Invalid assignment left-hand side.
I think the logic is correct and the issue is related to the publication status of the script?
H,
It seems you are missing and equal sign in the second argument to your if statement.