A powerful lambda helper function that applies a given formula or operation to each column of an array independently.
| Scenario | Formula | Remarks |
|---|---|---|
| Find the sum of each column in a range | =BYCOL(A1:D5, LAMBDA(col, SUM(col))) | If A1:D5 contains numbers, it will return the sum of each column. |
| A Formula to Find Maximum Value in Each Column | =BYCOL(A1:D5, LAMBDA(col, MAX(col))) | It will return the largest number in each column |
| Minimum Value | =BYCOL(A1:D5, LAMBDA(col, MIN(col))) | It will return the smallest number in each column |
| Count Non-Empty Cells | =BYCOL(A1:D10, LAMBDA(col, COUNTA(col))) | Counts how many non-empty cells are in each column. |
| Check if Any Value is Greater Than 50 in Each Column | =BYCOL(A1:D5, LAMBDA(col, SUM(--(col>50))>0)) | Returns TRUE if any number in a column is greater than 50 |