Excel functions / Logical

BYCOL function

Runs a function on each column of an array and returns one result per column.

Syntax

=BYCOL(array, lambda)

Arguments

When to use it

BYCOL runs a LAMBDA on each column of a range and spills one result per column across: a total row, an average row or any calculation of each column, in one formula.

Examples

  1. The total of each quarter

    ABC
    1Q1Q2Q3
    2102030
    3405060
    4
    5507090

    In A5: =BYCOL(A2:C3, LAMBDA(col, SUM(col))) → 50, 70, 90

    Try this example

  2. The average, by name

    ABC
    1Q1Q2Q3
    2102030
    3405060
    4
    5253545

    In A5: =BYCOL(A2:C3, AVERAGE) → 25, 35, 45

    Try this example

Common mistakes

Try BYCOL in the playground

Practise it

Related functions