View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
brantty brantty is offline
external usenet poster
 
Posts: 16
Default How to remove characters in a cell that precede a specific hyp

Ron, You are awesome. Great work. Its working exactly as I needed.

Ty

"Ron Rosenfeld" wrote:

On Thu, 3 Apr 2008 17:16:24 -0700, brantty
wrote:

I have a column of cells that have excess data that needs removed. The #of
characters vary. I'm needing a formula to delete all the characters that
precede the 2nd hyphen as well as delete the 2nd hyphen.

Ex. [ABC-12345-12345]

I need the cell to read [12345]

Can anyone provide a formula that can remove this data?


Assuming that your brackets [ ] are not really part of the value, then:

=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,"-",CHAR(1),2))+1,255)

will return everything after the 2nd hyphen.

--ron