reorganize string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a string, such as "msl=30mk/kg". I want to reorganize it to "30
(msl)". but the troubles are that the digits of number (30) is not stable,
this time 30, that time 40.89, maybe next time whatever it want to be.
Besides, the unit "mk/kg" is not stable, either.

till now, I have wrotten the following function. but the troubles listed
upon can't be solved yet. who can help me?

=MID(A1,FIND("=",A1,1)+1,2) & " (" & MID(A1,1,FIND("=",A1,1)-1) & ")"
 
=MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(A1,{0,1,2,3,4,5,6,7,8,9},""))))&LEFT(A1,FIND("=",A1)-1)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top