Highest per column, shown downward
| A | B | C | |
|---|---|---|---|
| 1 | Q1 | Q2 | Q3 |
| 2 | 10 | 20 | 5 |
| 3 | 7 | 3 | 9 |
Formula: E2: =TRANSPOSE(BYCOL(A2:C3,LAMBDA(c,MAX(c))))
Result: Spills down: 10, 20, 9
BYCOL returns a row; TRANSPOSE turns it into a column listing 10, 20 and 9.
BYCOL hands each column of a range to your LAMBDA in Google Sheets and gives back a row of results.
BYCOL(array, LAMBDA(column))Wrap it in TRANSPOSE if you want the results listed down a column instead.
For a fuller explanation of the arguments and common errors, see the BYCOL Excel guide.
| A | B | C | |
|---|---|---|---|
| 1 | Q1 | Q2 | Q3 |
| 2 | 10 | 20 | 5 |
| 3 | 7 | 3 | 9 |
Formula: E2: =TRANSPOSE(BYCOL(A2:C3,LAMBDA(c,MAX(c))))
Result: Spills down: 10, 20, 9
BYCOL returns a row; TRANSPOSE turns it into a column listing 10, 20 and 9.
| A | B | C | |
|---|---|---|---|
| 1 | Q1 | Q2 | Q3 |
| 2 | 10 | 20 | 5 |
| 3 | 7 | 3 | 9 |
Formula: E2: =TEXTJOIN(",",,BYCOL(A2:C3,LAMBDA(c,SUM(c))))
Result: 17,23,14
The three column totals are joined into one string.
| A | B | C | |
|---|---|---|---|
| 1 | Q1 | Q2 | Q3 |
| 2 | 10 | 20 | 5 |
| 3 | 7 | 3 | 9 |
Formula: E2: =MAX(BYCOL(A2:C3,LAMBDA(c,MIN(c))))
Result: 7
The column minimums are 7, 3 and 5, and the largest of them is 7.
A tiny spreadsheet with example data. Edit the formula or any number and see the result.
Formula in F2: =BYCOL(C2:D7,LAMBDA(c,MAX(c)))
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Product | Units | Price | Result | ||
| 2 | East | Pen | 120 | 2.5 | 120 | 25 | |
| 3 | West | Pen | 80 | 2.5 | |||
| 4 | East | Book | 45 | 12 | |||
| 5 | North | Book | 60 | 12 | |||
| 6 | West | Lamp | 30 | 25 | |||
| 7 | East | Lamp | 15 | 25 |
Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page