Skip to main content

How to extract text before or after dash from cells in Excel?

Most of us may like to use the dash separator to separate the contents within a cell, but, sometimes, we need to extract the text string before or after the dash for some purpose as following screenshot shown. How could you extract the text before or after the dash from cells at once in Excel?

doc extract after dash 1

Extract text before or after dash with formulas

Extract text before or after dash with Text to Columns feature

Extract text before or after dash with Kutools for Excel


To extract the text string before or after a dash, the following simple formulas may help you.

Extract text before dash:

Please enter this formula: =LEFT(A2,FIND("-",A2)-1) into a blank cell besides your data, see screenshot:

doc extract after dash 2

And then drag the fill handle down to the cells that you want to apply this formula, you can see all text before the dash has been extracted from the cell:

doc extract after dash 3

Extract text after dash:

Type this formula: =REPLACE(A2,1,FIND("-",A2),"") into a blank cell, then drag the fill handle to the range of cells that you want to contain this formula, and all the text after the dash has been extracted as follows:

doc extract after dash 4  2 doc extract after dash 5

Tips: In above formulas, A2 is the cell you need to extract text from, you can change it as you need.


In Excel, the Text to Columns feature also can help you to split the cell content from one cell into two cells separately by the dash.

1. Select the data range that you want to split by dash.

2. Click Data > Text to Columns, see screenshot:

doc extract after dash 6

3. In step 1 of the Convert Text to Columns Wizard, select Delimited option, see screenshot:

doc extract after dash 7

4. And then click Next button, in step2 of this wizard, check Other option under Delimiters section, and enter the dash (-) symbol into the text box, see screenshot:

doc extract after dash 8

5. And then click Finish button, the selected cells have been split into two columns by the dash. See screenshots:

doc extract after dash 9  2 doc extract after dash 10

Kutools for Excel’s Split Cells feature may help you split the cell contents into multiple columns or rows by any separators, such as comma, dash, carriage return, etc. See below demo. Click to download Kutools for Excel!

After installing Kutols for Excel, please do as follows:

1. Select the data range that you want to extract the values before or after the dash.

2. Then click Kutools > Merge & Split > Split Cells, see screenshot:

3. In the Split Cells dialog box, select Split to Columns under the Type section, and then enter the dash into the Other text box under the Specify a separator, see screenshot:

doc extract after dash 17 17

4. Then click Ok button, and another prompt box will pop out to remind you select a cell where you want to put the result, see screenshot:

doc extract after dash 18

5. And then click OK, the cell values in cells have been split into two columns by dash. See screenshot:

doc extract after dash 19

Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Download and free trial Now!

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (8)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Excellent! Thank you
Rated 5 out of 5
This comment was minimized by the moderator on the site
Ce n'est pas "TROUVER" mais "TROUVE"
This comment was minimized by the moderator on the site
Hello,
I want to know that how to extract text or word before or after particular text or word?Kindly help me in this case.Thank You...
This comment was minimized by the moderator on the site
Hello, Nimesh,To extract the text after or before a specific text, please apply the below formulas:After a text: =TRIM(MID(A2,SEARCH("and",A2)+LEN("and"),255)) (replace the text "and" to your own)Before a text: =LEFT(A2,FIND("and",A2)-1)
This comment was minimized by the moderator on the site
What if I want to extract only one word between two specific words from a sentence?

This comment was minimized by the moderator on the site
Hello,Thank you for response.Exactly, I want to extract only one word after or before a specific word from the sentence.Is it possible?
Thank You...
This comment was minimized by the moderator on the site
How do I pull the one word before a dash and after a space? Example..
Jane Doe-is and excellent person
Jane Sue Doe-is an excellent person
Jane Smith-Doe-is an excellent person

I only want the word "Doe" pulled from the cell.
This comment was minimized by the moderator on the site
I love you! This is exactly what I was looking for, you geniuses!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations