How to Extract Text Between Parentheses in Excel
Learn multiple Excel methods to extract text between parentheses with step-by-step examples and practical applications.
How to Extract Text Between Parentheses in Excel
Why This Task Matters in Excel
Every data professional eventually lands on a worksheet packed with notes, codes, or comments mixed into otherwise neat text strings. Those extra bits of information are often enclosed in parentheses and are critical for downstream analysis: product versions in sales descriptions, remark codes in medical billing, or cost centres tucked into general-ledger exports. If you cannot quickly pull out what is inside those parentheses you will spend hours cleaning data manually, risking errors and delaying insight.
Imagine an ecommerce analyst who receives an order export where the Description field reads “T-Shirt (XL) – Blue (Summer2024)”. Marketing only wants the seasonal collection label, Operations only needs the size. Without a reliable method the analyst might hack together copy-paste routines or manually split columns, compromising both accuracy and efficiency.
The need is equally pressing in finance. A controller reconciling expenses often receives memos such as “Hotel stay – London (GBP) (3 nights)”. Currency codes and duration have to be split into separate fields before amounts can be converted or durations summarised. Likewise, HR teams parsing payroll notes, scientists analysing lab sample names, and project managers reviewing task lists all benefit from seamless extraction of text between parentheses.
Excel shines here because it offers multiple built-in formulas, both legacy and modern, that solve the problem without add-ins or external scripts. Functions such as TEXTBETWEEN, MID, FIND, SEARCH, and new-generation dynamic arrays handle simple one-off cases as well as bulk extractions across tens of thousands of rows. Mastering these techniques unlocks cleaner data imports, faster pivots, and error-free dashboards. Failing to learn them keeps analysts stuck in repetitive clean-up tasks, pushing deadlines and increasing the chance of releasing incorrect reports. In short, extracting text between parentheses is a foundational skill that connects to broader Excel workflows: data cleaning, lookup operations, reporting, and automation.
Best Excel Approach
If you are on Microsoft 365 or Excel 2021, the TEXTBETWEEN function is the clear winner. It is purpose-built to return the substring that sits between a start delimiter and an end delimiter, handles missing delimiters gracefully, and supports case sensitivity options. For versions that do not include TEXTBETWEEN, a robust alternative is a MID + SEARCH combination. Both formulas require no helper columns, recalculate automatically, and work in tables, making them ideal for business use.
TEXTBETWEEN is superior when:
- You have current Excel versions
- You want a single, easy-to-read formula
- The delimiter characters will not vary
MID with SEARCH is preferable when:
- You need compatibility with Excel 2019 or earlier
- Delimiters might change and you want to customise the logic
- You need additional transformations inside the same formula
Basic syntax using TEXTBETWEEN:
=TEXTBETWEEN(A2,"(",")")
Parameters:
- A2 – the cell that contains the full text
- \"(\" – the start delimiter (first occurrence)
- \")\" – the end delimiter (first occurrence)
Legacy approach using MID + SEARCH:
=MID(A2,SEARCH("(",A2)+1,SEARCH(")",A2,SEARCH("(",A2))-SEARCH("(",A2)-1)
Logic breakdown:
- SEARCH finds the position of the opening parenthesis
- SEARCH finds the next closing parenthesis after that position
- MID starts one character after \"(\" and returns the difference in positions minus one, giving you the exact text in between.
Parameters and Inputs
Before building formulas, ensure your inputs meet certain criteria:
- Primary input: The cell containing text with at least one pair of parentheses. Data type is plain text, even if the cell is formatted as General.
- Delimiters: In our task the characters are the standard opening parenthesis “(” and closing parenthesis “)”. Both TEXTBETWEEN and SEARCH treat them as ordinary text strings, not regex tokens.
- Optional parameters (TEXTBETWEEN only):
– instance_num (which pair to extract if multiple exist).
– match_mode (0 for case-sensitive, 1 for case-insensitive; parentheses are not case-able, but surrounding text could matter).
– match_end (0 default finds next delimiter, 1 finds last delimiter). - Data preparation: Trim leading and trailing spaces to avoid hidden blanks in results. Use TRIM or CLEAN where necessary.
- Validation rules: If data can lack parentheses, wrap the formula in IFERROR or test with ISNUMBER(SEARCH(\"(\" ,A2)).
- Edge cases: Nested parentheses, missing closing bracket, line breaks inside text, or multiple pairs per cell. These require tailored handling shown in Example 3.
Step-by-Step Examples
Example 1: Basic Scenario
Suppose you have a simple product list in [A2:A7]:
| A |
|---|
| Coffee Mug (Red) |
| Coffee Mug (Blue) |
| Water Bottle (1 L) |
| Water Bottle (2 L) |
| Notebook (Plain) |
| Notebook (Ruled) |
Objective: Extract the colour or size within parentheses into column B.
Step 1 – Insert a new header in B1: “Attribute”.
Step 2 – In cell B2 enter:
=TEXTBETWEEN(A2,"(",")")
Step 3 – Press Enter. Excel 365 spills the result in B2 only (no spill array needed because single cell).
Step 4 – Drag the fill handle or double-click it to copy the formula to B3:B7.
Expected results:
| B |
|---|
| Red |
| Blue |
| 1. L |
| 2. L |
| Plain |
| Ruled |
Why it works: TEXTBETWEEN looks at the first \"(\" and the next \")\" and returns everything between. Because each description has only one pair and no nested brackets, the default parameters suffice.
Variations: If some rows miss parentheses, TEXTBETWEEN will return #N/A. Surround it with IFERROR:
=IFERROR(TEXTBETWEEN(A2,"(",")"),"")
Troubleshooting: If results contain extra spaces, nest TRIM around TEXTBETWEEN.
Example 2: Real-World Application
Scenario: A customer-support export contains call log summaries in column A. Each note ends with “(CaseID: ######) (Tier X)”. Management wants two separate columns: CaseID and Tier. Data example in [A2:A5]:
| A |
|---|
| Refund processed for delayed shipment (CaseID: 601122) (Tier 1) |
| Follow-up email sent (CaseID: 601198) (Tier 2) |
| Escalated to logistics (CaseID: 601356) (Tier 3) |
| Resolved, awaiting confirmation (CaseID: 601400) (Tier 1) |
Solution using dynamic arrays:
- Add headers B1 “CaseID”, C1 “Tier”.
- In B2 enter:
=TEXTBETWEEN(A2,"(CaseID: ",")")
- In C2 enter:
=TEXTBETWEEN(A2,"(",")",2)
Explanation: The fourth argument instance_num is set to 2, so TEXTBETWEEN starts being evaluated at the second opening parenthesis and extracts until the next closing parenthesis.
- Copy formulas down.
Results:
| CaseID | Tier |
|---|---|
| 601122 | Tier 1 |
| 601198 | Tier 2 |
| 601356 | Tier 3 |
| 601400 | Tier 1 |
Business value: Separating CaseID allows linking to ticketing systems via VLOOKUP or XLOOKUP; Tier enables quick filtering of escalations. The dynamic approach scales to thousands of rows with virtually no performance hit because TEXTBETWEEN is vectorised.
Performance Tips: Convert the range into an Excel Table (Ctrl + T). Formulas automatically fill new rows, and structured references stay readable:
`=TEXTBETWEEN(`[@[Log]],\"(CaseID: \",\")\")
Example 3: Advanced Technique
Challenge: Legacy Excel 2016 workbook with multiple nested parentheses and inconsistent data. Example strings:
| A |
|---|
| Widget-A (v2.4 (Beta) ) – Released |
| Widget-B (v3.0) – Stable |
| Widget-C (Discontinued (Old Stock)) |
| Widget-D (v1.9 (RC1)) – Testing |
Objective: Extract the innermost text, ignoring outer wrappers. Because TEXTBETWEEN is unavailable, we create a custom formula to find the last opening parenthesis before the first closing parenthesis.
- In cell B2 enter:
=LET(
txt,A2,
openPos,LOOKUP(2,1/(MID(txt,ROW(INDIRECT("1:"&LEN(txt))),1)="("),ROW(INDIRECT("1:"&LEN(txt)))),
closePos,SEARCH(")",txt,openPos),
MID(txt,openPos+1,closePos-openPos-1)
)
Explanation of LET variables:
- txt – holds the cell text for readability.
- openPos – uses a reverse LOOKUP trick to find the last \"(\" before any \")\". We generate an array of positions with ROW(INDIRECT()). LOOKUP(2,1/condition) returns the last TRUE index.
- closePos – searches for \")\" starting from openPos.
- MID extracts text between positions.
- Confirm with Ctrl + Shift + Enter in Excel 2016 because the formula is array-enabled.
- Copy down.
Results:
| Extract |
|---|
| Beta |
| v3.0 |
| Old Stock |
| RC1 |
Professional tips:
- The formula tolerates missing spaces because SEARCH from openPos ensures the correct closing bracket.
- Wrap in IFERROR to blank out rows lacking parentheses.
- Performance optimisation: Use a helper column to store LEN(txt) instead of recalculating for each variable.
Tips and Best Practices
- Prefer TEXTBETWEEN if you have Microsoft 365 or Excel 2021; it is shorter, easier to read, and less error-prone.
- Always TRIM or CLEAN source cells when importing from systems that may introduce invisible characters; trailing spaces inside parentheses will otherwise persist.
- Convert your data range to an Excel Table so formulas fill automatically and remain readable using structured references.
- Combine TEXTBETWEEN with TEXTSPLIT when you need to extract multiple items at once and spill them across columns.
- Shield formulas with IFERROR to keep dashboards tidy and prevent #VALUE or #N/A from breaking charts and pivot tables.
- Document complex legacy formulas with comments or the LET function so future maintainers understand each step.
Common Mistakes to Avoid
- Assuming every cell contains parentheses. Always test first or wrap with IFERROR; empty strings avert visual noise and later calculation errors.
- Forgetting to add or subtract 1 when using MID + SEARCH. Off-by-one errors lead to results that include the actual parentheses. Double-check the start_num and num_chars arguments.
- Using FIND instead of SEARCH when case sensitivity should not matter. FIND is case-sensitive and will fail on mismatched uppercase and lowercase parentheses substitutes in some rare locales.
- Dragging formulas down without locking delimiter references when using cells to store \"(\" and \")\" as variables. Use absolute references like $D$1.
- Overlooking nested parentheses. A basic SEARCH for \")\" following the first \"(\" fails when additional \"(\" appear inside; use advanced techniques or TEXTBETWEEN with match_end parameter.
Alternative Methods
Below is a quick comparison of approaches:
| Method | Excel Version | Complexity | Handles Multiple Pairs | Handles Nested Pairs | Performance |
|---|---|---|---|---|---|
| TEXTBETWEEN | 365 / 2021 | Low | Yes (instance_num) | Yes (match_end) | Excellent |
| MID + SEARCH | All | Medium | Yes (with extra SEARCH) | Limited | Very good |
| Power Query | 2010+ (with add-in) | Medium | Yes | Yes with scripts | Good for large data |
| VBA UDF | All | High | Customisable | Customisable | Depends on code |
When to choose each:
- Power Query is ideal for recurring ETL pipelines where you want a click-to-refresh solution and no worksheet formulas.
- VBA is useful when the workbook must stay compatible with very old Excel versions or you need complex parsing such as escaped parentheses.
- MID + SEARCH remains the best fallback when 365 features are unavailable and macro security is strict.
Migration strategy: Start with MID + SEARCH in an older file, document it well, and mark cells so that once your organisation upgrades to Microsoft 365 you can swap to the cleaner TEXTBETWEEN.
FAQ
When should I use this approach?
Use these techniques anytime a cell contains meaningful metadata inside parentheses that must become its own column: SKUs with sizes, project tasks with IDs, cost lines with account numbers, or research notes with specimen IDs.
Can this work across multiple sheets?
Yes. Prefix the range reference with the sheet name, for example:
`=TEXTBETWEEN(`\'Raw Data\'!A2,\"(\",\")\")
You can then consolidate results on a master sheet.
What are the limitations?
TEXTBETWEEN cannot process overlapping or malformed delimiters (for example, a missing closing bracket). MID + SEARCH needs extra logic for nested pairs. Both approaches return one result per formula call; extracting two values requires either two formulas or TEXTSPLIT.
How do I handle errors?
Wrap your main formula with IFERROR:
`=IFERROR(`TEXTBETWEEN(A2,\"(\",\")\"),\"Missing\")
For MID + SEARCH, test the SEARCH result with ISNUMBER before applying MID.
Does this work in older Excel versions?
MID + SEARCH works in any Excel version back to 2003. TEXTBETWEEN requires Microsoft 365 or Excel 2021. Power Query is available as an add-in for Excel 2010 and built-in from 2016 onward.
What about performance with large datasets?
TEXTBETWEEN is optimised and can handle over 100k rows rapidly because it is single-threaded but vectorised. MID + SEARCH is also efficient but avoid volatile functions such as INDIRECT inside large arrays. For millions of rows, use Power Query or import into Power BI.
Conclusion
Extracting text between parentheses is a deceptively simple skill that saves analysts countless hours and keeps datasets reliable. Whether you leverage the elegant TEXTBETWEEN function or craft a legacy MID + SEARCH formula, you gain the power to turn messy compound strings into structured fields ready for sorting, filtering, and analysis. Mastering this technique lays the groundwork for advanced text manipulation, from delimiter-based splits to full-scale data transformations in Power Query. Practice with the examples provided, embed the best practices into your workflow, and you will find your reporting and analytical projects flow smoothly, on time, and with fewer errors.
Related Articles
How to Show the 10 Most Common Text Values in Excel
Learn multiple Excel methods to list the 10 most frequent text values—complete with step-by-step examples, business use cases, and expert tips.
How to Abbreviate Names Or Words in Excel
Learn multiple Excel methods to abbreviate names or words with step-by-step examples and practical applications.
How to Abbreviate State Names in Excel
Learn multiple Excel methods to abbreviate state names with step-by-step examples, professional tips, and real-world applications.