Hello,

I've been having trouble working out a function I need, and search didn't turn out anything.

I have an Excel file in which cell "C10" lists a variable length string which contains a certain character ("-"), after which I need to discard characters I do not need. For example: supposing I have the string ThisString-1234567, I need to keep "ThisString" and discard "-1234567"

I use the following formula:
=IF(ISERROR(LEFT(C10,FIND("-",C10,3)-1)),"",LEFT(C10,FIND("-",C10,3)-1))

The problem is, that this works only if there is only one "-" in the string, but sometimes, I have "This-String-or-Another-1234567", and get left with "This", whereas I need to keep the whole string, dashes and all, EXCEPT for the last one and what comes after (i.e. I need "This-String-or-Another").

Could someone help me out?