Function Name: BYROW
BYCOL is the companion to the BYROW function. The purpose of BYROW is to process data in an array or range in a “by row” fashion. Specifically, BYCOL applies a LAMBDA function to each row in an array, returning one result per row in a single step. If BYROW is given an array with 100 rows, BYROW will return 100 results. The calculation performed on each row is flexible.
Syntax:
=BYROW(array, lambda(row))
The BYROW function syntax has the following arguments:
array An array to be separated by row.
lambda A LAMBDA that takes a row as a single parameter and calculates one result. The LAMBDA takes a single parameter:
row A row from array.
Purpose:
- Data Analysis: Quickly compute statistics like sum, average, or maximum for each column in a dataset.
- Dynamic Reporting: Create dynamic reports that automatically update based on column-wise calculations.
- Data Cleaning: Apply transformations or cleaning operations to each column in a dataset.
Examples
Example 1: Returns the maximum value of each row of data
Enter the sample data into cells A1:C2, and then copy the formula into cell D4:
=BYROW(A1:C2, LAMBDA(array, MAX(array)))
Example 2: Returns the sum of the squared values for each row of data using the SUMSQ function
Enter the sample data into cells A1:C2, and then copy the formula into cell D4:
=BYROW(A1:C2, LAMBDA(array, SUMSQ(array)))