Questions tagged [google-sheets-custom-function]

Use for questions about Google Sheets custom functions (created using Google Apps Script)

Custom function for Google Sheets, written in JavaScript.

Could be used together with

Useful resources

59 questions
0
votes
1 answer

Formula's permission error inside an Addon - getActiveUser

The custom formula I created isn't working due to a permission issue, but after following the guidelines I still can't understand what the problem is. I wrote a custom formula "SUMIFALL" that I published to other group members on the same domain as…
0
votes
1 answer

How to create a custom function that emulates the RANK formula?

Using Google Forms, I am collecting data for teachers to use in determining students who qualify for Title 1 services. The form feeds the data to Google Sheets, and I want to automate the process of summing scores by category and then ranking them…
0
votes
2 answers

How to print variables in google script

function checkWho(n,b) { // n and be are comparing two different cells to check if the name is in the registry var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var glr = sheet.getLastColumn(); var glr2 =…
0
votes
2 answers

Google script custom function errors workaround

I am using custom functions in spreadsheets for various operations. I have used properties service which values is cached. Also, I have send range of values to function instead of calling that function for hundred of times. I am using function for…
0
votes
0 answers

Why does my Google Apps script take so long to run when called with UrlFetchApp from a Google Spreadsheet?

I am using a custom function to keep modify a sheet's row count as data from another sheet changes. To do this, I had to put the script that does the modification into a standalone Google Apps script, since custom functions called directly from…
0
votes
0 answers

How can I use Google Script method UrlFetchApp.fetch within an ArrayFormula?

function getContentForAPI(path) { var result = {}; result.url = "https://" + HOST + "/rest/api/2/" + path; result.response = UrlFetchApp.fetch(result.url, API_HEADERS); result.text = result.response.getContentText(); try { result.data =…
0
votes
1 answer

Google Spreadsheet script, file access in Drive, "You do not have permission to call ..."

I have a Sheet where I need to get the id of a file located in my Google-drive. I have written the folowing script: function get_id_pdf() { var nom='INV432-altaïr-Famille XXX-XXX Marie-03-2016.pdf'; var files =…
0
votes
2 answers

You do not have permission to use copyTo

I'm trying to copy a range from one sheet to another (whilst preserving the formulas). I wrote a simple script using copyTo: function copyRangeAcrossSheets(source_sheet,source_range,target_sheet,target_range) { var spreadsheet =…
0
votes
2 answers

Clear a cell and fetch the Google sheet name

I want to make a script to clear a fixed cell on all sheets but the first four and fill the very same cell with the sheet name. So far I have a script to blank out the cell and the fill it with a new function the fetches the sheet name. The first…
0
votes
1 answer

Google script cannot find getRange nor does it have permission to run

I'm trying to make a Google sheet fetch actuarial data from another sheet; the other sheet essentially acts as a look-up table. The code (with the spreadsheet id removed): function deathProb(age,sex) { return…
0
votes
1 answer

Is there some way to populate all the cells from 1 function call instead of 1 call for each cell?

Here is my issue. I have a spreadsheet with multiple sheets, and each sheet has about 300-500 rows. I am using ScriptDb to store the data for each sheet. What I am currently doing is calling a custom function in 300-500 cells in each sheet to…
-1
votes
1 answer

AInternal Error executing custom function

Is there any limitation in Apps Script? I'm getting "internal Error" if I set variable "lLen" more then 18 - http://prntscr.com/j60kxb Actually I need to have this string as var lLen = CIDlist.length; but I'm getting the Error above. In some cases…
-1
votes
1 answer

Importrange in custom function

Hi Everyone I am trying to use "Importrange" function in a custom function (shown below). function csvLinks(sheetName,range) { var link1 ="\"https://docs.google.com/spreadsheets/d/1Gnqa4WOC7mRX2meqwrUCrh9dcS94mI0G-abc123\""; var link2 =…
-2
votes
1 answer

Calculating with time

EDIT:2020.07.24. Here is a spreadsheet where you can see my problem. https://docs.google.com/spreadsheets/d/1-knADrKsStLz5lS_9gayHpZFcaZPsEbBMmrpOGXGMqg/edit?usp=sharing I have a spreadsheet (That i can't share), made my own custom functions with…
1 2 3
4