Questions tagged [google-apps-script]

For questions about using Google Apps Script to extend Google applications

Google Apps Script is a JavaScript cloud scripting language that lets you extend Google Apps and build web applications.

Google Apps Script can be used in four explicit ways:

  1. creation of a customized function from within a worksheet, like =CUSTOMIZED(A4;TRUE)
  2. creation of a script from within a worksheet, like menus, automated tasks
  3. creation of a script from within Google sites, performing business logic
  4. stand-alone web application (script.google.com),

Furthermore, it allows you to access many of the Google Apps via services, making it a powerful tool.

References:

1830 questions
115
votes
6 answers

Is there a way to insert today’s date into a Google Docs?

I've looked under insert > ...? but couldn't find anything. Can this be done via an inbuilt function or a custom script?
sam
  • 7,107
  • 42
  • 100
  • 140
75
votes
8 answers

How can I set conditional formatting on a particular cell that depends on another cell's value?

In my example I would like to conditionally format column B cells. Those marked with x should be formatted according to value in column A (in the example the value is 1): A | B 1 | x 2 | 3 | 1 | x 1 | x 4 | 8 | // x can be any value and is here…
70
votes
3 answers

Link to specific sheet in Google spreadsheet

I have a complicated Google spreadsheet with many sheets and a table of contents. Is there some way to create a link to the sheet names so that with a click one can go directly to the sheet? That is: clicking on the cell "sheet5" switches to sheet5?
JBWhitmore
  • 953
  • 2
  • 7
  • 9
69
votes
13 answers

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: =myFunction(A1:A4) The problem is that when I try…
Senseful
  • 31,429
  • 39
  • 142
  • 198
58
votes
8 answers

Can I get header numbering in Google Docs?

Is there a way to automatically number headings in Google Docs? It used to be possible with CSS but this feature isn't supported anymore in the new Google Docs version.
Martin Delille
  • 737
  • 1
  • 5
  • 14
51
votes
13 answers

How to specify the entire sheet as range in Google Sheets?

The best workaround I have found so far is: worksheet_name!$A$1:$YY but ideally I would like to be able to simply write, e.g.: worksheet_name! So, does anyone know: is there a syntax for specifying a whole sheet as a range?
user6757
49
votes
5 answers

How to save temporary variables in Google Sheets formula?

I'm trying to create a formula in a Google spreadsheet which looks like this: if (x < 0, x + 1, x) It means if x is smaller than 0, return x + 1, else return x. However, x itself is an expression, e.g. A1 + B1. So I ended up with: if ((A1 + B1) <…
Pacerier
  • 6,373
  • 24
  • 68
  • 88
46
votes
6 answers

How can I automatically set "last updated" cell in row Google Docs Spreadsheets?

How can I automatically set "last updated" cell in row Google Docs Spreadsheets ? I want to create a column where the cells' value will be automatically set to when that row was last amended. Is this possible? How do I do this / what option do I use…
cwd
  • 824
  • 3
  • 10
  • 12
45
votes
7 answers

Alternating colors for lines in Google docs spreadsheet

I have a shared Google spreadsheet where several users have already filled out parts. It would be useful to have alternately colored lines to facilitate correct placement of additional data. Is there a painless method option to alternately color…
Phira
  • 561
  • 1
  • 4
  • 6
44
votes
3 answers

Auto-updating column in Google Spreadsheet showing last modify date

Trying to figure out a way to have column two auto-update to show a timestamp of the last update. I realize the doc shows a timestamp of the last modification, but we have a lot of clients accessing and adjusting the doc at the same time. So this…
43
votes
6 answers

Cumulative Sum without Script

For this question, I've created a Google Apps Script function, that calculates the cumulative sum of a range. Martin Hawksey on Google+ made a comment about a more efficient way of calculating the cumulative sum: function cumulativeSum(array){ var…
41
votes
11 answers

Is there any way to create a timestamp in a Google Spreadsheet?

I use PSPad as a text editor, which allows you to press Alt + D to insert a timestamp, e.g.: 2010-07-17 23:45:44 Is there a way to do this in a Google Spreadsheet?
34
votes
4 answers

How to automatically insert a new row and retain functions/formulas from last row?

I have a table with cells that have functions/formulas, like this one: I need a script that creates a new row, copying with it the functions/formulas of the last used row. I find this script which create a new row but it doesn't copy…
32
votes
4 answers

How do I convert a cell to RFC 3986 standard (URLEncoded) in Google Spreadsheets?

Is it possible to convert text from a certain cell to RFC 3986 (http://url-encoder.org/) in a Google Spreadsheet? Lets say C4 has the value John Doe, then D4 must be John%20Doe.
32
votes
9 answers

Text to columns conversion in Google Spreadsheets

How do you do a text-to-columns conversion in Google Spreadsheets? For example, I have the following data string in one cell: 5,233,6,2,6,7,2,2,6,6 I want to break it apart by the comma separator into columns. Edit: I changed the accepted answer…
Evan Plaice
  • 1,459
  • 1
  • 12
  • 24
1
2 3
99 100