Common apps script functions in Sheets

Google Sheets provides a wide range of functions to help you work with your data, but you can also create custom functions using Google Apps Script. Here are some of the most common custom Apps Script functions used in Sheets:

  1. onEdit(): This function is triggered when a cell or range of cells is edited. You can use this function to perform certain actions, such as updating related cells or sending email notifications.
  2. getValues(): This function retrieves the values of a range of cells and returns them as a two-dimensional array. You can use this function to work with data in your Sheet and perform calculations or other operations.
  3. setValues(): This function sets the values of a range of cells based on a two-dimensional array of values. You can use this function to update data in your Sheet based on calculations or other operations.
  4. getRange(): This function returns a range object based on the specified range of cells. You can use this function to select a range of cells and perform operations on them.
  5. getActiveSheet(): This function returns the active sheet object in the current Spreadsheet. You can use this function to access and work with data in the active sheet.
  6. getDataRange(): This function returns the range of cells that contains data in the active sheet. You can use this function to select all the cells with data in a Sheet and perform operations on them.
  7. Utilities.formatDate(): This function formats a date value based on the specified date format. You can use this function to format dates in your Sheet based on your preferred format.
  8. Math.round(): This function rounds a number to the nearest integer. You can use this function to perform calculations and round the result to the nearest whole number.

These are just a few examples of the many custom functions you can create using Google Apps Script in Google Sheets. The possibilities are endless, and you can use Apps Script to create custom functions to automate tasks, enhance functionality, and streamline your workflow in Google Sheets.