Applies a LAMBDA function to each column in an array and returns an array of the results.
Syntax
BYCOL(array, lambda)Arguments
arrayrequired
The array or range to be processed by column.
lambdarequired
A LAMBDA function that takes a single column as an argument and returns a calculated result.
The BYCOL function processes an array column by column, passing each column as an array to the specified LAMBDA function. It is particularly useful for performing column-wise calculations, such as finding the maximum or sum of each column in a data range.
=BYCOL(A1:C2, LAMBDA(col, SUM(col)))→Array of 3 sumsCalculates the sum of each of the three columns in the range A1:C2.
Define the input range
Select the array or range of cells you want to analyze column by column.
Create the LAMBDA function
Write a LAMBDA function that accepts one parameter representing a column and performs the desired operation.
BYCOL specifically iterates by columns, whereas MAP can iterate over arrays element by element.