View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default How to remove characters in a cell that precede a specific hyp

On Thu, 3 Apr 2008 20:06:01 -0700, brantty
wrote:

Ron,

I found some cells that were different,. Instead of looking for the 2nd
hypen, can you adapt a formula to keep all data after the LAST hyphen?

Ty


Yep. It's just a matter of changing the "2" (for the 2nd hyphen) to a formula
that calculates the number of hyphens:



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