Explanation
LAMBDA functioncan be used to create custom, reusable functions in Excel.
This example illustrates a feature called recursion, in which a function calls itself.
Recursion can be used to create elegant, compact, non-redundant code.
This example is primarily proof of concept, to show a very simple recursive LAMBDA function.
MID strips one character at a time, which is why this formula is recursive.
The result is given to the StripTrailingChars function, along with the original value forchar.
When all the target trailing characters have been removed, the function returns the current value forstr.
you’re able to find more general information about the LAMBDA functionhere.
For example, =MID(“apple”,2,3) returns “ppl”.
LEN will also count characters in numbers, but number formatting is not included.