Thread: Remove dash(s)
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Paul Mathews
 
Posts: n/a
Default Remove dash(s)

Hi Pierre,

Let's say that one of your data items is in cell A1. Set an open adjacent
cell to:

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

"Pierre" wrote:

Maybe someone here could provide guidance:

Have a column containing data which may have 1-3 dashes locates within
each cell value.
Such as:
125-457A
158-857-1116
124184A-1
125-8745-22D9
458-2145-002-7


Would like to remove all the dashes "unless" the last dash to the right
is followed by a just a single digit. The results would be as follows:
125457A
1588571116
124184A-1
125874522D9
4582145002-7

On the example data, it kept 2 of the dashes in the cell values,
because the were only one digit away from the extreme right, but
removed all others.

TIA for any thoughts.

Pierre