Skip to content

Instantly share code, notes, and snippets.

@m-ocean-it
Created April 18, 2022 12:36
Show Gist options
  • Save m-ocean-it/ceb4535f0e98233191c8911c376c8680 to your computer and use it in GitHub Desktop.
Save m-ocean-it/ceb4535f0e98233191c8911c376c8680 to your computer and use it in GitHub Desktop.
AppScript (Google Sheets): MIN & MAX functions for ARRAYFORMULA
function ARRAYMIN(xx, yy) {
return xx.map((x, idx) => {
const y = yy[idx]
return Math.min(x, y)
}
}
function ARRAYMAX(xx, yy) {
return xx.map((x, idx) => {
const y = yy[idx]
return Math.max(x, y)
}
}
@m-ocean-it
Copy link
Author

Example:

=ARRAYFORMULA(ARRAYMIN(A1:A10, B1:B10))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment