Custom functions have been in Google Apps Script since it’s public launch in 2009. These let you extend Google Sheets function list allowing you to create and share your own spreadsheet formula. This post provides some guidance on writing custom Google Sheet functions that can handle both single and range inputs
Source: Google Apps Script Patterns: Writing custom formulas/functions and handling single and range inputs – MASHe
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.