Location of the last "s" in a text string
Hi!
Try this:
=FIND("~",SUBSTITUTE(A1,"s","~",LEN(A1)-LEN(SUBSTITUTE(A1,"s",""))))
Note: no error checking. If "s" doesn't exist = #VALUE
The tilde chararter is used as a "marker". The "marker" can be any unique
character(s) that DOES NOT appear in the string.
Biff
"PCLIVE" wrote in message
...
I've got a cell with some text in it.
Example - A1 has the text "This is a test"
I'm trying to come up with a formula that will tell me the location of the
last "s" in this cell. I've tried using a FIND function, but that will
only give me the first occurrence starting at whatever position I specify.
How can I get the location of the last "s" without knowing a starting
position?
Thanks,
Paul
|