TEXTBEFORE Function in Excel: Syntax, Examples & Practice
Learn the Excel TEXTBEFORE function: Returns text before a delimiter. Try focused practice and download a free workbook.
Syntax
=TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])
Requires Microsoft 365 or Excel 2024 on desktop. Perpetual Excel 2021 does not include this function. Check your platform and update channel before using it.
Worked example
| Row | A: Customer name | B: Code | C: Raw text |
|---|---|---|---|
| 2 | amit kumar | MH-10245 | Mumbai - Active |
| 3 | Priya Shah | MH-20418 | Pune - Active |
| 4 | Ravi Patil | MH-33021 | Nashik - Closed |
=TEXTBEFORE(B2,"-")
Expected result: MH
The original text is shown beside the fields that TEXTBEFORE will inspect, clean or transform.
Professional use
Modern text extraction.
Practice TEXTBEFORE · Download practice .xlsx
Apply your skills
Explore MIS and finance projects
Questions and answers
How can I practise TEXTBEFORE?
Use the focused ten-question TEXTBEFORE lab, then download its workbook for ten additional function-specific tasks and an answer key. Core learning works without an account.
Which Excel version supports TEXTBEFORE?
Requires Microsoft 365 or Excel 2024 on desktop. Perpetual Excel 2021 does not include this function. Check your platform and update channel before using it.
Does the browser simulator replace Microsoft Excel?
No. It supports a selected set of formula behavior for practice. Native workbook recalculation, full function compatibility, PivotTables and external data features must be checked in your own Excel installation.
Interactive practice runs in your browser.