Questions tagged [google-sheets-custom-function]

Use this tag for questions about custom functions in Google Sheets created by using Google Apps Script.

Filter by
Sorted by
Tagged with
1
vote
2answers
2k views

Having Google Sheets not recalculate a formula on page load

I have a Google Sheet with a list of addresses, and a column that geocodes the addresses with mapquest via Google App Script. This works great, except it "recalculates" the addresses on page load. ...
-1
votes
2answers
43 views

IF and THEN statements on spreadsheets using color

I am creating spreadsheets with multiple tabs for children to work through. To show they have completed each tab, when they have finished the work correctly I am using the following statements: =IF(...
1
vote
2answers
2k views

Cell values ​do not update

I want to update every minute a cell with data from a HTML link. The problem is that the value does not update unless I manually empty the cell or make changes to the script. I tried to add NOW() to ...
0
votes
3answers
2k views

How to make that a custom function update its result immediately

I'm using a custom function to read the sheet name (shown in the tab) and then return the name to the cell in the summary page. The script works, however it doesn't update when I change the name of ...
1
vote
1answer
37 views

Google Sheets - How to count the occurrence of each day of the week if they are not public holidays?

I would like to count the occurrence of each day of the week in a month if they are not national holidays. In more details, I would like to know how many Mondays, Tuesdays, Wednesdays, Thursdays, and ...
1
vote
1answer
46 views

Copy formula every other row and every column

I have been playing with scripts to try and figure out this tedious task as there are 600ish rows in my sheet, times 4 sheets. So far I have come up with this function myFunction() { var ss =...
0
votes
1answer
389 views

Google sheet - get crypto currency price from Cryptobridge Exchange API

How can I retrieve only the price from this API in a Google spreadsheet? This is the API ticker - https://api.crypto-bridge.org/api/v1/ticker For example, if I use this function =INDEX(IMPORTDATA(...
0
votes
1answer
43 views

Cut and paste data from a row of cells from one tab to another tab in Google Sheets and repeat with new data

The below code works for Q3 but not for Q5. I'm relatively new to sheets and writing code and I'm sure that you can't have two functions with the same name but am unsure how to resolve so that I can ...
-1
votes
2answers
31 views

Empty cell reference when “Loading…”

I want to do a calculation with imported data from an HTML link. The data is imported every minute. There is loading time and this ensures that the cells are empty during loading. Because my formula ...
0
votes
0answers
11 views

How to make one cell automatically update a timestamp every time another referenced cell is updated? [duplicate]

I want to make a cell in my spreadsheet that updates a timestamp every time another cell is updated. I have a SUMIF connected to a budget inflows/outflows tab in my spreadsheet and I want this cell ...
0
votes
3answers
3k views

LEFT JOIN two and more tables in Google Sheets

Say I have two tables. Table A (material requirements): product_id | material | required 1 | A | 0.5 1 | B | 0.7 2 | A | 0.2 3 | A | 0....
0
votes
2answers
822 views
1
vote
2answers
995 views

Is there a way to get MD5 Checksum from the files with a custom formula?

I have a Google Sheet full of important links to images on Google Drive. Is there a way to get MD5 Checksum from the files with a custom formula? Here is my scenario: No. | PHOTO | MD5 ...
1
vote
3answers
75 views

Using a script to only take only take cells with values in google sheets

tl;dr how can I make the script take an entire column (eg A:A) and then ignore the first (header) row, and any blank rows? Background I have an array in Google Sheets with date-ordered data (note ...
0
votes
1answer
59 views

How to update this formula so it automatically updates?

It's come to my attention that GoogleClock no longer works on new sheets, anyway I can update the below code so it can update every minute: Tried put =SheetNames(NOW()) It says not allowed. I'm very ...
0
votes
1answer
84 views

Scitpt to duplicate template sheet into new workbook, then rename

I am looking for a script that will create a menu item that will allow me to copy a template sheet that I have created (multiple times) into a new workbook, and rename the copies at the same time. ...
3
votes
1answer
6k views

How can I solve error “Exceeded maximum execution time” in Google Sheets?

I found a script which I really need (link): function getTotalSum(cell) { var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); var sum = 0; for (var i = 0; i < sheets.length ...
3
votes
1answer
2k views

How can I reference a cell in a custom function while setting up data validation in Google spreadsheets?

I made the following Google script to check whether a string is less than some length: function isLengthLessThan(length, text) { return (text.length < length) }; How can I set up data ...
2
votes
1answer
173 views

Google Sheets Passing Range from separate sheet into custom function

I have the following custom function I've built to basically reproduce a needle haystack type of functionality function ListBy (Range, Range2, needle) { var holder = []; if(typeof Range != '...
0
votes
2answers
11k views

How to format the time in this Google Apps Script

I want to format a Google Sheet cell when I read it in my script but it comes out 25 minutes later. The cell's time is 20:00:00 but the output is 20:25. I am using this var formattedDate = Utilities....
2
votes
3answers
406 views

Code invoked too many times

My goal is pretty simple: take the value in column U and check if it's within particular ranges. If it's 1–100, put a 1 in column A. If it's 101–200, put a 2 in column A. The problem is, I have almost ...
2
votes
1answer
1k views

Prevent “invoked too many times per second” error in Google Apps Script

I have a Google spreadsheet consisting of different months on each tab. Every month, I add a new tab and another 50-75 rows. There are many tabs. There is a cell on each row which calls a custom ...
1
vote
1answer
47 views

ArrayFormula stops working after shuffling rows

I have a pretty extensive sheet wherein many columns I use an array formula to automatically fill data in from various other spreadsheets. The problem I have is when I need to rearrange rows then what ...
0
votes
1answer
628 views

Steam Webapi & Hours played for a specific game - Google Sheets

So I have managed to get a list of owned games and total hours in each game with =importJson. The only issue is I only want data for one game. The json query returns all owned games. The api wiki says ...
1
vote
1answer
35 views

How to do permutation of characters and print it horizontally along that row in Google Sheets?

I am stuck here in printing permutation of two or more characters horizontally along that row in which the characters are. Is it possible? Because I searched it all over and only found vertical ...
1
vote
1answer
258 views

Using custom function in QUERY in Google Sheets results in “unknown function:”

I have a custom function written in Google Script for Sheets named sheetnames(). It returns the names of individual sheets inside a worksheet. When used in a regular cell-like =sheetnames(), it ...
1
vote
1answer
33 views

Convert a text of a specific cell or exclude one cell from all text convertion to UPPERCASE

How to adapt this function to exclude a specific cell or how to apply just to one cell? function onEdit(e) { if (typeof e.value != 'object') { e.range.setValue(e.value.toUpperCase()); } }
0
votes
1answer
1k views

How to reference a Google Sheet by filename?

How to reference a Google Sheet by filename? I would like to use IMPORTRANGE function, but it can only reference a file by URL not by filename. Example filename: 2018-11.xlsx 2018-12.xlsx
0
votes
2answers
297 views

Custom SHEETNAME function not working in Arrayformula

I have been successfully deploying the sheetname function outlined in Display sheet name in Google Spreadsheets for a couple of years. It has allowed me to have several sheets collecting information ...
0
votes
1answer
946 views

Split multi-line (comma-separated) cell into new rows + duplicate surrounding row entries

Based on: Google sheets split multi-line cell into new rows (+ duplicate surrounding row entries) How can I rewrite this for use of a comma as separator and remove blank spaces? Input sheet: ...
2
votes
1answer
14 views

Format cell, If word from list in cell

I'm trying to color tag cells according to keywords they may contain. I've searched just about everywhere, and have tried various applications of the Search and Find functions to no avail. Imagine I ...
0
votes
1answer
47 views

Reference all tabs with a specific word in COUNTIF statement

Basically, I am trying to make a master tab that adds up all of the data from all the other tabs. These tabs are weekly breakdown numbers for ad statistic numbers, so there is a new tab added every ...
0
votes
1answer
1k views

How to use custom function with arrayformula?

I'd like to use a Google Apps Script custom function in conjunction with arrayFormula so this may be applied to a range. How do I achieve this? Let's say I have wrote a function that will return ...
2
votes
2answers
305 views

ARRAYFORMULA with IF, DETECTLANGUAGE and LEN

I'm trying to make an array formula to detect the number of English characters in a range. When I use the following for individual cells: =IF(DETECTLANGUAGE(ARRAYFORMULA(A5:A))="en",LEN(ARRAYFORMULA(...
1
vote
1answer
147 views

Custom Script in Pivot Table Value Formula = Error Loading Data forever

I am very new to the Google Sheets platform, but I am not new to programming, and am comfortable creating and managing javascript code, and reading API documentation. I am working on a side project, ...
44
votes
12answers
52k views

How to pass a range into a custom function in Google Spreadsheets?

I want to create a function which takes in a range... something like: function myFunction(range) { var firstColumn = range.getColumn(); // loop over the range } A cell would reference it using: ...
0
votes
0answers
55 views

Automatically import a range from a different Google Sheet at HOURLY intervals

In a google sheet, I have a dynamically changing cell that updates production every few minutes. Each hour, I want to pull the new number to my alternative sheet, so that I may get the total ...
0
votes
0answers
151 views

Is there a way that I can flag in Google Sheets when multiple cells contain the same values?

I'm wondering if someone can help me in my battle with Google Sheets. I'm creating a rota and I want it to flag if all senior members of staff are either off or all on the same shift (either Early or ...
1
vote
0answers
24 views

How to Get Data from Multiple Cells and Combine into a Comment in another cell

I have a spreadsheet of orders (rows) that has room for 70 products (columns). I would like for a script to find every cell that has a value (0's are blank) and then write that value (this is the qty ...
0
votes
1answer
304 views

How to get new Google Form responses to take on non-form functions in Google Sheets

I developed a Google Form that copies responses to a linked output spreadsheet in Google Sheets. In addition to the columns created by the form question/responses themselves, I've added additional ...
6
votes
1answer
9k views

Detect whether a cell has strikethrough format

Is there a function that checks if the strikethrough format has been applied to the cell contents? I would like use a formula similar to (=IF(HAS_STRIKETHROUGH(C5), 1,0)
0
votes
1answer
97 views

Conditional Formatting IF/AND (Google Sheets)

I'm trying to highlight cells in column N when the following criteria are met: K = number (don't count text or blanks) N = blank L = date Column K is formatted as a number The formula I used: =AND(...
1
vote
2answers
2k views

Multiple IF statements: IF, AND, ISDATE, THEN formula

I'm trying to get a nested formula to work, but I keep getting an error. I tried using the generic formula =IF(AND(A1="this",B1="that"),"x","") but couldn't figure out how to make sure Q6=date. I had ...
1
vote
1answer
1k views

Conditional Formatting COUNTIFS (Google Sheets)

I'd like column P to be highlighted when: A contains "x" E contains "approved" O < today (date has passed) P and Q are blank My formula doesn't work: =COUNTIFS(A6:A, "x", E6:E, "approved", ...
0
votes
0answers
62 views

How to auto date on cell update in Google Sheets

I'm using the following script in Google Sheets. It works well but I want to limit it to a specific tab rather than every tab in the book. function countBackground(color, inputRange) { var ...
6
votes
1answer
808 views

Test Google Spreadsheets Add-On with custom functions

I have set up a Google Apps Scripts project with the intent of creating a Google Spreadsheets add-on with custom functions. However, when I use the option "Test as add-on", I can't use the functions ...
4
votes
2answers
1k views

How do I reference existing formulas from custom formulas in Google Spreadsheet Scripts?

I want something essentially like this: function contains(arg1, arg2) { return NOT(ISERROR(search(arg1, arg2))); } But NOT and ISERROR are undefined even though using =ISERROR(...) works in the ...
1
vote
1answer
1k views

Getting values from other sheets with a custom function

I've defined the following function, and use it in sheet1: function myfcn (sheetname,rowstart,rows,columnstart,rows){ var sheet= SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetname); ...
2
votes
1answer
2k views

Is there any reliable alternative to IMPORTRANGE()?

After some time the formula breaks, and shows Error: Loading data..., and it won't work until I change anything in the parameters, e.g. Sheet1!a3:Ag to Sheet1!a3:AG, then it works for a few days, and ...
6
votes
1answer
443 views

Non-deterministic parameters to custom function

I have a problem with Google Spreadsheets: I create a custom function using the Script Editor and it only runs OK if the parameters I pass are known (constant) values. If the parameters are non-...