BYCOL
The BYCOL
function in Google Sheets is used to group an array by columns by applying a LAMBDA
function to each column. This function is useful when you need to perform operations on columns separately rather than on rows.
Function Syntax and Parameters
Syntax: BYCOL(array_or_range, LAMBDA)
Parameters:
array_or_range
: The array or range to group by columns.LAMBDA
: The function to be applied to each column.
Step-by-Step Tutorial
-
Using
BYCOL
with an array:- Example:
=BYCOL(A1:C3, LAMBDA(x) -> MIN(x))
- Result: This will apply the
MIN
function to each column of the arrayA1:C3
and return the resulting array.
- Example:
-
Using
BYCOL
with a range:- Example: If the range
A1:C3
has the values:
Then5 10 3 8 2 7 4 6 9
=BYCOL(A1:C3, LAMBDA(x) -> AVERAGE(x))
will return the array:5.66667 6 6.33333
- Example: If the range
Use Cases and Scenarios
- Data Analysis: Perform column-based calculations or aggregations on data.
- Statistical Analysis: Compute column-wise statistical measures such as mean, median, or standard deviation.
- Data Transformation: Perform transformations on each column independently.
Related Functions
ARRAYFORMULA
: Apply a formula to an entire array range.TRANSPOSE
: Transpose rows and columns in a range.