I've been working on Google Scripts for a bit, but I can't seem to find the solution to my problem. What I am trying to do is multiply the contents of two cells on a spreadsheet together with my function calculateRates()
. Here is my code:
/**
@customFunction
*/
function calculateRates(hourDecimal, personRate) {
var ss = SpreadsheetApp.getActiveSpreadsheet(); //Access spreadsheet
var sheet = ss.getSheets()[0]; //Access sheet
var range = sheet.getDataRange(); //Access all cells
var values = range.getValues(); //Call to get value of certain cell
var totalEarned = hourDecimal * personRate;
Logger.log(totalEarned);
return totalEarned;
}
The problem with it is that after I designate two cells to multiply together as the parameters of the function on the spreadsheet, there is an error that reads "Result was not a number." I know I have the function correct on my spreadsheet, so that can't be the problem..... Any ideas? Thanks for your help!