Copy all text to the left of the hyphen

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
654
Office Version
  1. 2019
Platform
  1. Windows
Hi:

I have data in column D (see example below)

XXXXX - yyyyyy
ZZZ - ccccc
DDDDDDDDD - ddddd

I want to copy all text to the left of the hyphen to column E.

Could you help me.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
654
Office Version
  1. 2019
Platform
  1. Windows
Domski/jonmo1/Cbrine:

Thanks.

Now that I have copied the data into column E, I have duplication. Would it be possible to copy all data to the right of the hyphen?
 
Upvote 0

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Do you just want to seperate the data so you have 2 columns, 1 with the data to the left of the hyphen, and one with the data to the right?
I.E..

Start with

A1 = XXXXX - yyyyyy

End up with

A1 = XXXXX
B1 = yyyyy

??

Try Data - Text to Columns
Select Deliminated
Check Other and enter a hyphen
 
Upvote 0

Sean15

Well-known Member
Joined
Jun 25, 2005
Messages
654
Office Version
  1. 2019
Platform
  1. Windows
jonmo1

Perfect solution, thank you.


Sean
 
Upvote 0

Forum statistics

Threads
1,190,897
Messages
5,983,447
Members
439,843
Latest member
PlanetFitness

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top