Skip to content
Google Sheets

BYCOL function in Google Sheets

Groups an array by columns by application of a LAMBDA function to each column.

=BYCOL(array_or_range, LAMBDA)

BYCOL syntax and parameters

Two arguments, two required.

  • array_or_rangeanyRequired

    An array or range to be grouped by columns.

  • LAMBDAanyRequired

    A LAMBDA that’s applied to each column in the given array or range to obtain its grouped value. Syntax: LAMBDA(name,formula_expression) Requirements: The LAMBDA must have exactly 1 name argument along with a formula_expression which uses that name. The name resolves to the current column being grouped when the LAMBDA is applied.

BYCOL examples

Formulas you'll actually reuse.

  1. A totals row for twelve monthly columns in one formula:

    =BYCOL(B2:M13, LAMBDA(col, SUM(col)))
  2. The spread (max minus min) of each month's figures:

    =BYCOL(B2:M13, LAMBDA(col, MAX(col) - MIN(col)))

BYCOL in Excel

Same name — your formula ports as-is.

Try BYCOL in the playground

Edit the example — nothing to install.

Preloaded with the BYCOL formula from Example 1 — change anything and watch it respond.

Loading the editor…