Excel BYCOL function


The Excel BYCOL function applies a LAMBDA function to each column in a given array and returns an array of the results. This powerful function is ideal for performing column-wise calculations on a range of data, enabling you to summarize or analyze each column individually. BYCOL simplifies complex array operations, making it easier to work with multidimensional data in Excel.
					=BYCOL(array, lambda(column))
  • array: The array or range to be processed by columns
  • lambda: The LAMBDA function that takes a column as its parameter and performs calculations to produce a single result per column
Return value
An array where each element is the result of applying the LAMBDA function to a column in the original array.

How to use

To use BYCOL, define the array you want to analyze and specify the LAMBDA function that describes the operation to be performed on each column. The LAMBDA function should take a single argument representing a column from the array and return a single value based on that column.


Simple BYCOL
Calculating the Total for Each Column: To sum the values in each column of a range.
					=BYCOL(range, LAMBDA(column, SUM(column)))
This formula processes each column in the specified range, sums up its values, and returns an array of these sums.
BYCOL for Maximum Values
Identifying the Largest Number in Every Column: To find the maximum value in each column of a range.
					=BYCOL(A1:C2, LAMBDA(column, MAX(column)))

Applies the MAX function to each column within the specified array, returning the maximum value from each column.
BYCOL for Minimum Values
Finding the Smallest Value in Each Column: To determine the minimum value in each column.
					=BYCOL(A1:C2, LAMBDA(column, MIN(column)))

Utilizes the MIN function within a LAMBDA to identify and return the smallest value from each column in the array.
BYCOL for Average Values
Calculating the Average for Each Column: To compute the average value of each column in a range.
					=BYCOL(A1:C2, LAMBDA(column, AVERAGE(column)))

This calculates the average of the values in each column, returning an array of average values for the specified range.
BYCOL to Count Cells Over a Value
Counting Cells Greater Than 50 in Each Column: To count the number of cells with values over 50 in each column.
					=BYCOL(A1:C2, LAMBDA(column, SUM(--(column>50))))
In this example, a custom calculation within LAMBDA counts how many cells in each column have values greater than 50, illustrating the flexibility of BYCOL for tailored data analysis tasks.

Additional Notes

  • BYCOL, combined with LAMBDA, opens up a wide range of possibilities for data manipulation and analysis by allowing users to apply specific operations to each column of an array independently.
  • This function streamlines the process of performing column-wise calculations, making it simpler to extract insights from multidimensional data sets.

Related Functions

Excel MAKEARRAY function

The Excel MAKEARRAY function generates arrays using lambda functions, offering flexibility in array creation and manipulation.

Excel LET function

The Excel LET function assigns names to calculation results, simplifying formulas and improving performance by reducing repetition.

Excel LAMBDA function

The Excel LAMBDA function creates custom functions without VBA, enabling complex calculations and reusable formula components.

Excel BYROW function

The Excel BYROW function applies a lambda function to each row in a range or array, facilitating row-based operations and analysis.

Excel REDUCE function

The Excel REDUCE function aggregates elements of an array, allowing for cumulative calculations and data reduction operations.

Excel SCAN function

The Excel SCAN function cumulatively applies a lambda function across an array, generating an array of intermediate results.

Content Navigation