<< Go back to all functions

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

  1. 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 array A1:C3 and return the resulting array.
  2. Using BYCOL with a range:

    • Example: If the range A1:C3 has the values:
      5  10  3
      8  2   7
      4  6   9
      
      Then =BYCOL(A1:C3, LAMBDA(x) -> AVERAGE(x)) will return the array:
      5.66667  6  6.33333
      

Use Cases and Scenarios

  1. Data Analysis: Perform column-based calculations or aggregations on data.
  2. Statistical Analysis: Compute column-wise statistical measures such as mean, median, or standard deviation.
  3. 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.

Related Articles