Removing text between hyphens and removing the hyphens

S

sonofroy

I am a bit new with regards to excel but If have a column of data that has
values in this format (note the placement of the hyphens)

9999- RR - AAAAAAAAAA

The length of 9's are constant at 4
The length of A's can change between cells

I would like to remove the R's and hypens to have this:

9999 AAAAAAAAAAA

Any suggestions? Thanks for your help
 
D

Dave Peterson

Select the range to fix
Edit|Replace
what: -bRRb- (b represents the space character
with: (leave blank)
replace all
 
J

Jim Thomlinson

=LEFT(A1, 4) & MID(A1, FIND("-", A1, 6)+1, 256)

Where your text is in cell A1
 
G

Gary''s Student

If the 9's are fixed in number then all you need to do is to remove a fixed
length prefix:

=MID(A1,11,256)

This assumes the R's, the dashes, and the spaces are fixed in number and
position.
 
S

sonofroy

This just came up but what if I want to put back one hyphen to look like this?

9999 - AAAAAAAAAAAAAAA
 
D

David Biddulph

Did you try -1 instead of +1 ?
--
David Biddulph

sonofroy said:
This just came up but what if I want to put back one hyphen to look like
this?

9999 - AAAAAAAAAAAAAAA
 

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