Skip to content

Instantly share code, notes, and snippets.

@karlpokus
Last active May 24, 2018 13:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlpokus/aab276bc0559a889d076 to your computer and use it in GitHub Desktop.
Save karlpokus/aab276bc0559a889d076 to your computer and use it in GitHub Desktop.
google sheets API
// count by regex
COUNTIF(range, "F1*")
// countif more/less
COUNTIF(range, ">2015-01-01")
// countif NOT
COUNTIF(range, "<>Läkare")
// url - google sheets regex syntax
var url = "https://github.com/google/re2/blob/master/doc/syntax.txt"
// reference to variable in cell that will not move on drag :)
var noMover = "$A$1"
// convert to number - date, time or string
VALUE()
// convert from number to string (num, format)
TEXT()
// filter vs sumifs and countifs
"Only use FILTER to return values (not to count as it will always return at least 1)"
"Use COUNTIF(S) or SUMIF(S) to calculate"
// return latest date
MAX()
// scripts editor
data[columnIndex][rowIndex]
// if data is single array
typeof data[0] == 'Object' // true
typeof data[0][0] == 'String' // true
data[0][0][0] // first letter of string :)
// if data is array of arrays
data[0] // row 0
data[0][0] // row 0 column 0
data[0][0][0] // row 0 column 0 correct cell type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment