manipulate string

daveyc18

Well-known Member
Joined
Feb 11, 2013
Messages
788
Office Version
  1. 365
  2. 2010
hi...

trying to make this

Lindros Luxur Stairway (11122412)

[TABLE="width: 412"]
<tbody>[TR]
[TD="class: xl94, width: 412, align: left"][/TD]
[/TR]
</tbody>[/TABLE]

into a different arrangement


11122412- Lindros Luxur Stairway

...

can somebody help use a formula to do this ? the number of digits will always be the same (eight), but the text will vary.
 
Last edited:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Give this formula a try...

=SUBSTITUTE(MID(A1&A1,FIND("(",A1)+1,LEN(A1)-2),")"," - ")
 
Upvote 0
alternative

PowerQuery <==> Get&Transform

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    SplitAndReplace = Table.ReplaceValue(Table.SplitColumn(Source, "raw", Splitter.SplitTextByDelimiter(" (", QuoteStyle.Csv), {"raw.1", "raw.2"}),")","",Replacer.ReplaceText,{"raw.2"}),
    Merge = Table.CombineColumns(SplitAndReplace,{"raw.2", "raw.1"},Combiner.CombineTextByDelimiter(" - ", QuoteStyle.None),"result")
in
    Merge[/SIZE]

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]raw[/td][td][/td][td=bgcolor:#70AD47]result[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Lindros Luxur Stairway (11122412)[/td][td][/td][td=bgcolor:#E2EFDA]11122412 - Lindros Luxur Stairway[/td][/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,113
Messages
6,189,046
Members
453,522
Latest member
Seeker2025

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top