Excel: How to Remove Characters After Dash


You can use the following formula in Excel to remove characters after a dash in a cell:

=TEXTBEFORE(A2, "-")

This particular formula removes all characters after the dash (and including the dash) from cell A2.

The following example shows how to use this formula in practice.

Example: Remove Characters After Dash in Excel

Suppose we have the following dataset in Excel that contains a phrase that classifies various NBA teams as elite, great, good or bad:

Suppose we would like to remove all characters after the dash (and including the dash) from each cell in column A.

We can type the following formula into cell B2 to do so:

=TEXTBEFORE(A2, "-")

We can then click and drag this formula down to each remaining cell in column B:

Excel remove characters after dash

Column B contains the text in column A with all of the text after the dash (including the dash) removed.

Bonus: Remove Characters After Second Dash

If you have a cell with multiple dashes and you’d like to remove the characters after the nth dash, you can specify a value for n as the third argument of the TEXTBEFORE function.

For example, you can use the following formula to remove all characters after the second dash in a cell:

=TEXTBEFORE(A2, "-", 2)

The following screenshot shows how to use this formula in practice:

Excel remove characters after second dash

Column B contains the text in column A with all of the text after the second dash removed.

Note: You can find the complete documentation for the TEXTBEFORE function in Excel here.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

Excel: How to Remove Specific Text from Cells
Excel: How to Remove Special Characters
Excel: How to Insert a Character into a String

Leave a Reply

Your email address will not be published. Required fields are marked *