Replace first hyphen in a cell

H

Huber57

All:

I have searched the posts and on Google but I can't find the answer.

I have a cell:

Kemet - ECJ-1238FG47KGCH1

I want to replace only the first hyphen in the cell with a | so I can use
Text to Columns.

Is there a better way?

Thanks much.
 
J

Joel

Why can't you just use Text - to column and select OTHER and put in the OTHER
box the dash?
 
E

Eduardo

Hi,
you don't need to replace the Hyphen to use text to columns just go to text
to columns,delimited, others

but if you want to replace it do

CTRL H
find what Hyphen, replace with

if this helps please click yes, thanks
 
C

Commish

All:

I have searched the posts and on Google but I can't find the answer.

I have a cell:

Kemet - ECJ-1238FG47KGCH1

I want to replace only the first hyphen in the cell with a | so I can use
Text to Columns.

Is there a better way?

Thanks much.

Have you tried the SUBSTITUTE function?

=SUBSTITUTE(A1,"-","X",1)

Assuming the text string that you posted above is in cell A1, and you
want to replace the hypen with an X, that will work.
 
H

Huber57

I could but then it would split the example below into three cells. I only
want two cells.

Make sense?
 
H

Huber57

As I re-read my first post, I don't think i was clear.

I have a column of cells. In that column, there is a manf. name and manf.
part number separated by a hyphen. I would like to split them out using text
to columns. Unfortunately, the manf. number could also have a hyphen. My
thought was to replace the hyphen that divides the two with another character
I know is not in the manf part number.

Does that help?
 
J

Jacob Skaria

With your data in cell A1 try the below to remove the first hyphen

=SUBSTITUTE(A1,"-","",1)

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top