Concatenation

This formula usesconcatenation, which means joining values to formtext strings.

For more on VLOOKUP, seethe detailed overview here.

At the end of the article, we look at how to replace VLOOKUP withXLOOKUP.

Original formula without LET function

The first part of the message looks like this:

So far, so good.

The second part is conditional.

The final formula is:

This formula works fine, but it’s getting a bit unwieldy.

Original formula without LET function

Thinking about variables

To use the LET function, we need to think aboutvariables.

Both of these lookups appear twice in the formula, so this is a good opportunity to simplify.

Lastly, we add aresult.

Original formula without LET function

The result is the final result returned by LET.

This is typically a calculation, adjusted to use the declared variables.

In this case, we’ll use “name” forname1, and “points” forname2.

Original formula without LET function

Next, we need to add the calculation that determines a final result.

Here is the result in Excel.

The rest of the formula did not change.

Original formula without LET function

More than one condition can be tested by nesting IF functions.

XLOOKUP supports approximate and exact matching, wildcards (* ?)

for partial matches, and lookups in vertical or horizontal ranges….

Converted formula with LET and line breaks

Example of LET function with XLOOKUP

Excel formula: List upcoming birthdays

Excel formula: LAMBDA strip characters

Excel formula: Get days, months, and years between dates

Excel LET function

Excel VLOOKUP function

Excel IF function

Excel XLOOKUP function

Original formula without LET function

Converted formula with LET and line breaks

Example of LET function with XLOOKUP