BYCOL Function in Google Sheets

Apply a custom function to each column in an array using the BYCOL function.

BYCOL Function

The BYCOL function in Google Sheets applies a specified LAMBDA function to each column of an array or range.

Syntax

BYCOL(array_or_range, LAMBDA)
  • array_or_range: The range or array to apply the function to.
  • LAMBDA: A custom function to apply to each column.

Examples

  1. Basic Example

Apply a custom function to each column in range A1:C3:

=BYCOL(A1:C3, LAMBDA(col, SUM(col)))

This calculates the sum of each column in the range.

Notes

  • The LAMBDA function defines the operation to perform on each column.
  • BYROW: Apply a custom function to each row in an array.