Create the TEXT.SELECT LAMBDA Function in Excel for Mixed Text
Question details
Create and use a custom TEXT.SELECT LAMBDA function to extract selected character types from mixed text.

- Product
- Microsoft Excel custom LAMBDA function
- Device & OS
- not provided
- Scenario
- The user wants to filter mixed text for numbers, English letters, uppercase or lowercase letters, spaces, or selected punctuation such as characters used in email addresses.
- Observed behavior
- The intended result is a reusable worksheet function with the syntax =TEXT.SELECT(MixedText,Select,Space,Keep).
Make sure your spreadsheet version supports the LAMBDA function and dynamic-array formulas. Have the TEXT.SELECT LAMBDA definition ready before creating the named formula in Name Manager.
Define TEXT.SELECT as a named LAMBDA in Excel Name Manager
Use this method to make TEXT.SELECT available as a reusable custom function throughout the workbook.
TEXT.SELECT is not a built-in Excel function. It must first be saved as a named formula containing its LAMBDA definition, then it can be called from worksheet cells.
In Excel, select the Formulas tab and choose Name Manager, then click New to create a workbook-level named formula.
Enter TEXT.SELECT in the Name field. In the Refers to box, paste the complete LAMBDA formula definition for TEXT.SELECT, including the MixedText, Select, Space, and Keep parameters.
Click OK, then click Close in Name Manager. The TEXT.SELECT name can now be used in worksheet formulas in the current workbook.
Select a result cell and enter =TEXT.SELECT(A2,Select,Space,Keep), replacing A2 and the remaining arguments with the text and selection settings you need.

Configure TEXT.SELECT to retain email address characters
Use this approach when extracting a structured value, such as an email address, that needs specific punctuation preserved.
Use WPS Spreadsheets to build reusable TEXT.SELECT-style formulas
WPS Spreadsheets provides a familiar formula workspace for creating, testing, and applying custom text-extraction logic to mixed values. Use named formulas and worksheet functions to organize text-cleaning workflows and keep compatible spreadsheet files ready to share.
- 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, choose Spreadsheets, and open the XLSX workbook containing the mixed-text data.
- 2. Create a formula area: Insert a blank column beside the source data and select the first result cell, such as B2.
- 3. Enter the text-selection formula: Type your TEXT.SELECT-style formula in the formula bar, referencing the source cell and the character settings required for the output.
- 4. Check representative results: Press Enter and verify results for values containing numbers, upper- and lowercase letters, spaces, and punctuation.
- 5. Fill the formula down: Drag the fill handle from the result cell down the column to apply the formula to the remaining rows.

Frequently Asked Questions
Is TEXT.SELECT a built-in Excel function?
No. TEXT.SELECT is a custom function created with LAMBDA. Define it first through Formulas > Name Manager > New, then call it by name in worksheet cells.
How do I keep spaces in TEXT.SELECT results?
Set the Space argument to 1 in =TEXT.SELECT(MixedText,Select,Space,Keep). Use 0 when the result should exclude spaces.
How can TEXT.SELECT preserve the @ symbol and period in an email address?
Include the characters in the Keep argument, for example {".";"@";"-"}. The function can then retain those symbols while extracting the selected text.
Why does TEXT.SELECT not return characters from another language?
The custom LAMBDA may only define logic for supported English or specified non-English character ranges. Update the LAMBDA logic if it must recognize additional scripts or character sets.
Can I use a TEXT.SELECT LAMBDA in another workbook?
Not automatically. Named LAMBDA functions are usually stored with the workbook, so copy the named formula through Name Manager or copy the workbook template that contains it.




