ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   reorganize string (https://www.excelbanter.com/excel-worksheet-functions/148794-reorganize-string.html)

ViestaWu

reorganize string
 
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) & ")"

Bob Phillips

reorganize string
 
=MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"01234 56789")),SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(A1,{0,1,2,3,4,5,6,7,8,9},""))))&LEF T(A1,FIND("=",A1)-1)

--
HTH

Bob

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

"ViestaWu" wrote in message
...
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) & ")"





All times are GMT +1. The time now is 07:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com