BYCOL Function

Runs a LAMBDA on each column of a range and returns one result per column.

Category

Logical

Available in

Microsoft 365, Excel 2024

Returns

A spilled row, one result per column

Taught hands-on in Level 5: Expert Techniques & Workbook Architecture - Modern Functions module

Overview

BYCOL is BYROW turned sideways: your LAMBDA receives one column at a time and returns a single value for it.

The results spill across, lining up neatly under (or over) the columns they summarise.

Syntax

=BYCOL(array, lambda(column)) Explain

Arguments

ArgumentRequired?What it does
arrayYesThe range to work through, column by column.
lambdaYesA LAMBDA with one parameter (the column) that returns a single value.

Examples

Example 1 — Quarter totals

Total each quarter in one formula in B6.

B6fx=BYCOL(B2:D5, LAMBDA(c, SUM(c)))
ABCD
1RepQ1Q2Q3
2Ana120150130
3Ben90110100
4Cara200180220
5Dev809575
6Total490535525
=BYCOL(B2:D5, LAMBDA(c, SUM(c))) Explain

Example 2 — Best result per quarter

Swap SUM for MAX to find each quarter's top figure.

=BYCOL(B2:D5, LAMBDA(c, MAX(c))) Explain

Returns 200, 180, 220.

Common mistakes

  • #CALC! errors. The LAMBDA returned an array instead of one value per column.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.