LAMBDA functions do not require VBA, but are only available inExcel 365.

The next step is to convert this formula into a generic (unnamed) LAMBDA formula.

We will need two input parameters, one for the text, and one for the strings to test.

The standard Excel formula in action

These need to appear as the first arguments in the LAMBDA formula.

The final argument contains the calculation to perform, which is adapted from our standard Excel formula above.

The next step in creating a custom LAMBDA is to name and define the formula with theName Manager.

The standard Excel formula in action

This makes the formula “more friendly” to most users.

In Excel 365, the SUM function will work in these cases without any special handling.

Since LAMBDA is only available inExcel 365, this example uses SUM, since SUMPRODUCT provides no additional benefit.

The standard Excel formula in action

SUMPRODUCT Function

The Excel SUMPRODUCT function multipliesrangesorarraystogether and returns the sum of products.

These values can be numbers, cell references, ranges, arrays, and constants, in any combination.

SUM can handle up to 255 individual arguments.

The standard Excel formula in action

SEARCH Function

The Excel SEARCH function returns the location of one text string inside another.

SEARCH returns the position offind_textinsidewithin_textas a number.

SEARCH supports wildcards, and isnotcase-sensitive….

The standard Excel formula in action

Testing the generic LAMBDA formula

LAMBDA version defined in Name Manager

Custom LAMBDA function in action

Excel formula: Count total words in a cell

Excel formula: LAMBDA replace characters recursive

Excel formula: LAMBDA count words

Excel LAMBDA function

Excel SUMPRODUCT function

Excel SUM function

Excel ISNUMBER function

Excel SEARCH function

The standard Excel formula in action

Testing the generic LAMBDA formula

Custom LAMBDA function in action