Questions tagged [custom-function]

DO NOT USE THIS TAG ALONE. Unlike built in functions where the functions are designed by the product designers for mass use, Custom functions are functions that are custom designed for only a subset of end users. Use for questions relating to such functions along with the product in question(eg [sql], [google-sheets],[excel]).

545 questions
6
votes
0 answers

Google sheets add-on custom functions not recognised/working

Situation: I have created a new project in Google Apps Script suite. In my Code.gs I have defined two custom functions like so: Problem: When I try to follow the procedure to test the add-on (instructions here), with latest code and configuration…
nlv
  • 791
  • 7
  • 28
6
votes
4 answers

Set Maps API key in Script Editor

As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate…
Paul Krat
  • 69
  • 1
  • 4
6
votes
2 answers

Custom Functions and Recalculation

I have a custom function that accepts three range names as input parameters. When values of cells in these ranges change, the function output stays the same. This is a "feature" of the platform. Is there any proper way (as of yet) to make custom…
user27636
  • 1,070
  • 1
  • 18
  • 26
6
votes
3 answers

Cell coloring in google-spreadsheet fails if it is called from a cell, but works ok when called from the script.

I have created the following simple function: function test(r,c) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); sheet.getRange(r,c).setBackground("red"); return 1; } In the spreadsheet, I write…
5
votes
1 answer

What amount of JsDoc is supported in Google Sheets custom functions?

Google implies that JsDoc is supported: Custom functions will appear in this list if their script includes a JsDoc @customfunction tag, as in the DOUBLE() example below. https://developers.google.com/apps-script/guides/sheets/functions But it…
Magne
  • 16,401
  • 10
  • 68
  • 88
5
votes
1 answer

Do not have permission to use setFormula Google appScript

I am trying to make a script where I have the address of the cell. In excel, I have this code: Function pos(cell As Range) pos = cell.Address End Function And it gives me the address of the cell. On Google app script I tried this…
5
votes
1 answer

Google sheet cell recalculation

I'm creating a board game and I have decided to choose Google sheets for that purpose. I have reduced my problem to a minimal example consisting of one sheet and one script. Situation Following points refer to my dice sheet: Cells B2:C5 contain…
5
votes
4 answers

Google sheet not updating custom function return value

I am very new to Google Apps Script (as well as JavaScript, for that matter), but I have been trying to tinker with it for fun. I have tried writing a script to fetch API price data in Google Sheets, but am finding that the returned value is not…
5
votes
1 answer

Spark Scala - How to group dataframe rows and apply complex function to the groups?

i am trying to solve this super simple problem and i am already sick of it, I hope somebody can help my out with this. I have a dataframe of shape like this: --------------------------- | Category | Product_ID | |------------+------------+ | a …
5
votes
5 answers

Why does array_uintersect() compare elements between array1 & array2, array1 & array1, and array2 & array2?

Test script $i = 0; array_uintersect(['foo', 'bar'], ['baz', 'qux'], function($a, $b) use (&$i) { print_r([$a, $b, $i++]); }); Actual Result Array ( [0] => bar [1] => foo [2] => 0 ) Array ( [0] => qux [1] => baz [2] =>…
The Onin
  • 5,068
  • 2
  • 38
  • 55
5
votes
1 answer

Accessing the Cell Coordinates in custom function

Is there a way to access the cell coordinates (in A1 notation) of the cell that was passed in to my function? For example, if my function is this function displayA1Notation(myCell){ return myCell.getA1Notation(); } and I put the following in cell…
Colorado Techie
  • 1,302
  • 1
  • 13
  • 21
4
votes
1 answer

Exceeded maximum execution time (line 0)

I have a .tsv file from a tool and I have to import it the Google Sheet (nearly) real-time for reports. This is my code for importing: function importBigTSV(url) {return Utilities.parseCsv(UrlFetchApp.fetch(url).getContentText(),'\t');} It worked…
4
votes
2 answers

Use custom function with custom parameters in keras callback

I am training a model in keras and I want to plot graphs of results after each epoch. I know that keras callbacks provide "on_epoch_end" function that can be overloaded if one wants to do some computations after each epoch but my function takes some…
Asim
  • 1,430
  • 1
  • 22
  • 43
4
votes
1 answer

Can I see the SQL in progress when an EntitySqlException is thrown, or can I override an EntityCommandCompilationException?

I've gone down a bit of a rabbit hole trying to execute a window function in Entity Framework. (The project in question is built on EF but would gain a lot from calculating PERCENTILE_DISC on the SQL Server.) I'm creating a new Convention and adding…
4
votes
3 answers

Google Sheets - Track Current Cell Selection?

How to Get the currently selected cell/range? was asked 3.5 years ago, but I'm hoping maybe some progress was made since then. I'd like to make an interactive spreadsheet where there's a boolean grid that will display more information about the…
Vince
  • 467
  • 3
  • 8
1 2
3
36 37