1. Introduction to Excel BYROW
The
BYROW
function allows you to apply a Lambda function to each row in a range and return an array of results.2. BYROW Parameters
Here is the syntax for using the
BYROW
function.=BYROW(array, lambda(row))
array
: required The array or range to which the Lambda function is applied. This can be a single row, multiple rows, or an entire table.lambda
: required The Lambda function to apply to each row. The row parameter refers to the row in the array. The Lambda function takes a row parameter and computes a result.3. Getting Started with the BYROW Function
Here we take the classic example of calculating the total of a column.
Keyboard input:
Keyboard input:
=BYROW(
4. Select the Source Data Range
At this point, the function prompts you to select the source data range. Click the start of the source data at
B5
, then hold down the Shift
key and click the end of the source data at D7
. This way, you can select the contents of the source data and fill them into the function parameter: =BYROW(B5:D7
.5. SUM as a Lambda Function
Here we pass in the Lambda function for column processing. Excel will intelligently suggest a series of functions that can be passed in, all designed for processing a column of data. Here we choose
SUM
as the Lambda function.6. Almost Finished
After passing in the
SUM
function and adding the closing parenthesis, the call to the BYROW
function is complete.7. BYROW Function Takes Effect
Press Enter, and we can see that the total has been successfully calculated for each row.
8. Abbreviation of Lambda Functions
Some may wonder why the second parameter requires a Lambda function, but passing
SUM
works too? Actually, the current call is equivalent to: =BYROW(B5:D7, LAMBDA(row, SUM(row)))
.9. Using in Combination with Other Functions
Similarly, we can combine other functions as Lambda functions to use.
For example, here we use
For example, here we use
SUM
+ LEN
to count the number of characters: =BYROW(B10:D12, LAMBDA(row, SUM(LEN(row))))
10. 🎉 Finish! 🎉
Author's Note: I hope you can feel the effort I put into these tutorials. I hope to create a series of very easy-to-understand Excel tutorials.If it is useful, help me share these tutorials, thank you!
Follow me: