Skip to content

Instantly share code, notes, and snippets.

@AlexVipond
Last active July 2, 2021 19:09
Show Gist options
  • Save AlexVipond/8fa9f5bb88d3823101bfaed97e91a31d to your computer and use it in GitHub Desktop.
Save AlexVipond/8fa9f5bb88d3823101bfaed97e91a31d to your computer and use it in GitHub Desktop.
Useful tricks in Google Sheets

Useful tricks in Google Sheets

Formulas

Generate ID

=ArrayFormula(
  if(
    len(A2:A),
    sequence(match(2,1/(LEN(A2:A) > 0),1),1),
    ""
  )
)

Custom formulas

Fetch data

// The Google Sheets user can type `=FETCH('https://example.com')` into a cell to fetch their data
async function FETCH (url) {
  const response = await UrlFetchApp.fetch(url),
        responseText = await response.getContentText(),
        responseJson = JSON.parse(responseText)
  
  // Return something to display in the Google Sheet.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment