View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Umlas
 
Posts: n/a
Default Find last occurance of character in text string

=LEFT(A1,FIND(CHAR(171),SUBSTITUTE(A1,"
",CHAR(171),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))-1)
and fill down.
Bob Umlas
Excel MVP

"JDay01" wrote in message
...
I am working with a spreadsheet that contains product descriptions. The
descriptions have varying lengths, but all have a "suffix" code of some

type
at the end of the description that I would like to eliminate. Here is an
example of the data I'm working with:

10 OZ GREEN BEANS Rfg
12 OZ CHILI WITH MEAT AND BEANS Grocery

In this example, I need to eliminate the " Rfg" in line 1, and the "
Grocery" text in line 2. My hunch is that I need to use a combination of
"FIND" and "LEFT" to basically find the last occurance of "space", then

bring
back the leftmost "n" characters based on the position of that last

"space".
Can someone help??