Deleting characters after a hyphen

T

TheIOU

I have an excel sheet with a column of about 50 products (get this exce
sheet weekly).

What I need to do is they have keys in the column like


- c4500-fds5
- cdfa4500-94kp
- c234500-94d
- eee4500-o430
- czzz4500-ei5


I need to delete everything (batch wise if I can) so it deletes th
hypen and all the characters after it so it shows


- c4500
- cdfa4500
- c234500
- eee4500
- czzz4500


anyway to do this in excel
 
T

TheIOU

Cool, I'll give this a go. Thanks for your help.

Nope, not a test question. I am done with school ;).

I just get this every week from a client and they just informed me that
after the hypen doesn't matter and I wanted to do it in the excel sheet.
Either that or I would've just had to do it through programming when I
upload the file for the web.
 
L

L. Howard Kittle

Hi David,

Perhaps I am misunderstanding your statement:

....the 2 in the following indicates the second occurrence of the find string
search argument.
=LEFT(A26,FIND("-",A26,2)-1)

Isn't the 2 telling Find where to start the search for "-"? It's not
telling Find to go to the second accordance of "-".

Testing the formula on this string, - c4500-fds5, you can use 2, 3, 4, 5,
6, 7 or 8 and it will return - c4500.

Regards,
Howard
 
D

David McRitchie

Hi Howard,
You are correct, sorry about that, and fortunately the formula is correct,
because the checking starts at the 2nd position..
 
Top