The dataset contains information about the names of some employees and their delivery times & dates of products. We do not want the delivery time which is in between two curly braces.
Method 1 – Remove Text between Two Characters in Excel with Find and Replace
We will remove the text between curly braces from the following image.
STEPS:
- Press Ctrl + H to open the ‘Find and Replace’ dialog box.
- In the ‘Find what’ box, type an asterisk surrounded by two curly braces ({*}).
- Keep the ‘Replace with’ box empty.
- Click on the ‘Replace All’ button.
- Excel shows a message box how many replacements were made.
- Click on OK.
- Close the ‘Find and Replace’ dialog box.
Read More: How to Remove Text After Character in Excel
Method 2 – Use Flash Fill to Remove Text between Two Characters in Excel
We’ll add a column for updated values.
STEPS:
- Select cell C5.
- Type the expected result of cell B5 in cell C5.
- Press Enter.
- Start typing the relevant value of cell B6 in cell C6. Excel will show a preview of the remaining cells that follow the same pattern whenever it detects a pattern in the data you’re inputting.
- Accept the suggestions by hitting Enter.
- We get the text of cell (B5:B9) in cell (C5:C9) without the instances between curly braces.
Read More: How to Remove Text before a Space with Excel Formula
Method 3 – Apply Excel Functions to Remove Text between Two Characters
We will use a combination of various functions to get the result in the column.
STEPS:
- Select cell C5.
- Insert the following formula in that cell:
=IFERROR(SUBSTITUTE(B5,MID(LEFT(B5,FIND("}",B5)),FIND("{",B5),LEN(B5)),""),B5)
- Press Enter.
- We get the value of cell B5 in cell C5 without the text between curly braces.
- Drag the Fill Handle tool from cell C5 to C10 to copy the formula of cell C5 in other cells.
How Does the Formula Work?
- LEN(B5): This part returns the length of a text string in cell B5.
- FIND(“{“,B5): Finds the “{“ character in the string of cell B5.
- MID(LEFT(B5,FIND(“}”,B5)),FIND(“{“,B5),LEN(B5)): This part measures the length of string “{“ from first position.
- SUBSTITUTE(B5,MID(LEFT(B5,FIND(“}”,B5)),FIND(“{“,B5),LEN(B5)),””): Substitutes text between the characters “{“ with empty value.
- IFERROR(SUBSTITUTE(B5,MID(LEFT(B5,FIND(“}”,B5)),FIND(“{“,B5),LEN(B5)),””),B5): If the previous part returns an error the IFERROR function returns the value of cell B5.
Read More: How to Remove Everything After a Character in Excel
Download the Practice Workbook
Related Articles
- How to Remove Specific Text from Cell in Excel
- Remove Text from an Excel Cell but Leave Numbers
- How to Remove Letters from Cell in Excel
<< Go Back To Excel Remove Text | Data Cleaning in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!