Excel Text Editing

  • Thread starter Thread starter S Halk
  • Start date Start date
S

S Halk

I would like to delete all text that is to the right of a
hyphen in many cells top to bottom of the spreadsheet; I
also want to delete the hyphen. The text left of the
hyphen is of various lengths but a maximum of 9
characters, both letters and numbers.
 
If your data is in a single column, you could use Data|Text to columns

Then delimited (by a dash)

Then choose to skip the fields you don't want.

Or maybe just Edit|replace would work for you:
Select your cells
edit|replace
what: -* (dash asterisk)
with: (leave blank)

replace all
 
S,

In a helper column (row, whatever), put
=LEFT(C2,SEARCH("-",C2)-1)
where C2 is the cell. That should yield the text you want. To permanently
change the original stuff, you can now copy the formula cell, then select
the original stuff, Edit - Paste Special - Values, then trash the formula
cell.
 
Back
Top