However, you could also use theLAMBDA functionto create a custom function to combine ranges.

It’s a good example of how the LAMBDA function andLET functionwork well together.

Inside the LET function, the first six lines of code simply assign values to variables.

Excel formula: LAMBDA append range

Once values are assigned, these variables drive the output of the function.

Ifcolindexis less than or equal to the count of the columns inrange1(2),INDEXfetches columns fromrange1.

If thecolindexis greater than 2, INDEX fetches columns fromrange2.

Excel formula: LAMBDA split text to array

In both cases,rowindexis used to retrieve rows.

LET Function

The Excel LET function lets you define named variables in a formula.

you could use INDEX to retrieve individual values, or entire rows and columns.

Excel formula: LAMBDA replace characters recursive

The array can be one dimensional, or two-dimensional, determined byrowsandcolumnsarguments.

Excel formula: LAMBDA count words

Excel formula: LAMBDA contains one of many

Excel LAMBDA function

Excel LET function

Excel INDEX function

Excel SEQUENCE function