BYCOL Function

Excel Functions › Logical

Excel 365

The Excel BYCOL function hands each entire column of a range to a LAMBDA and spills one result per column, across a single row. It is the one-formula totals row: SUM each month, MAX each column, count passes per test — without copying a formula sideways. Its twin BYROW works the same way, row by row.


Quick answer: to total each month’s column in B2:E4 with one formula:
=BYCOL(B2:E4, LAMBDA(c, SUM(c)))
The LAMBDA’s parameter c receives a whole column (three cells at once), so put an aggregation like SUM, MAX, or AVERAGE inside.

Syntax

=BYCOL(array, lambda(column))
ArgumentDescription
arrayRequiredThe range or array to process column by column.
lambdaRequiredA one-parameter LAMBDA. The parameter receives one complete column as a vertical vector — not a single cell — and the body must boil it down to a single value.

Available in: Excel for Microsoft 365 and Excel for the web only. Older versions show #NAME?. The output is a one-row array spilling sideways — one value per input column.

A totals row from one formula

Sales per rep sit in B2:E4, one column per month. One formula in B5 builds the entire totals row:

ABCDE
1RepJanFebMarApr
2Ava120135150140
3Ben95110105125
4Caro140120160155
5Total355365415420
=BYCOL(B2:E4, LAMBDA(c, SUM(c))) // spills 4 totals across B5:E5

Inside the LAMBDA, c is the whole column — B2:B4 on the first pass, C2:C4 on the second. Any range aggregation fits:

=BYCOL(B2:E4, LAMBDA(c, MAX(c))) // best single result per month
=BYCOL(B2:E4, LAMBDA(c, AVERAGE(c))) // average per month
=BYCOL(B2:E4, LAMBDA(c, COUNTIF(c, ">=120"))) // reps at quota, per month

Try it: aggregate each column live

Live demo

Choose what the LAMBDA does to each column and watch the spilled row update.

Per-column logic and dynamic-array combos

Verdicts per column work just like aggregates — any single-value expression goes in the body:

=BYCOL(B2:E4, LAMBDA(c, IF(SUM(c)>=400, "On pace", "Behind"))) // a flag per month

Feed BYCOL’s spilled row to other functions. Which month had the highest total?

=INDEX(B1:E1, MATCH(MAX(BYCOL(B2:E4, LAMBDA(c, SUM(c)))), BYCOL(B2:E4, LAMBDA(c, SUM(c))), 0))

Cleaner with LET, which computes the totals once:

=LET(t, BYCOL(B2:E4, LAMBDA(c, SUM(c))), INDEX(B1:E1, MATCH(MAX(t), t, 0))) // returns "Apr"

Family map: per-row results are BYROW; element-by-element transforms are MAP; one grand total with custom step logic is REDUCE; building a grid from row/column indexes is MAKEARRAY.

Errors & common pitfalls

#CALC! — the LAMBDA returns an array, not a single value. Each column must collapse to one result. LAMBDA(c, c*2) returns a whole column of values per column — BYCOL can’t place it. To transform every cell, use MAP.

#CALC! — wrong parameter count. BYCOL’s LAMBDA takes exactly one parameter (the column vector). Declaring two, or none, fails.

#NAME? — older Excel. BYCOL exists only in Excel for Microsoft 365 and Excel for the web. Excel 2021 and earlier don’t recognize it.

Pitfall: the parameter is a vector, not a cell. LAMBDA(c, c>100) compares the whole column at once and yields an array — wrap it in an aggregate: LAMBDA(c, SUM(c)>100).

Pitfall: it spills sideways. BYCOL returns a horizontal row — the cells to the right of the formula must be empty, or you get #SPILL!. Wrap the call in TRANSPOSE if you want the results vertical.

Practice workbook

📊
Download the free BYCOL practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What does the Excel BYCOL function do?
BYCOL runs a LAMBDA once per column of a range, passing the whole column in as a vector, and spills a single row with one result per column — column totals, monthly maximums, or any custom per-column calculation.
What's the difference between BYCOL and BYROW?
Direction only. BYCOL slices the range into columns and returns one value per column (a horizontal result); BYROW slices it into rows and returns one value per row (a vertical result). The LAMBDA pattern is identical.
Why does BYCOL return #CALC!?
Usually the LAMBDA body returns an array instead of a single value (e.g. c*2), or the LAMBDA doesn't declare exactly one parameter. Each column must reduce to one result — wrap it in SUM, MAX, COUNTIF, or similar.
How do I make BYCOL results vertical?
BYCOL naturally spills across a row. Wrap it in TRANSPOSE to flip it: =TRANSPOSE(BYCOL(B2:E4, LAMBDA(c, SUM(c)))) — handy when the results feed a vertical report.
Which Excel versions support BYCOL?
Excel for Microsoft 365 and Excel for the web only. Excel 2021 and earlier show #NAME?; there a row of copied formulas is the fallback.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: BYROW · LAMBDA · MAP · REDUCE · MAKEARRAY · SCAN · TRANSPOSE