Formula needed for removal of [] and data in.

chetan123

New Member
Joined
Dec 17, 2016
Messages
4
Can someone help me in providing formula for removing [] and data in it?


<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
DATARESULTS
ABC [2.5], JKB [23.3]ABC, JKB
Norway [.45]Norway
Smaller then1-5 days [12.5],5-12 days [34.5],13-25 days [23.3], 26-50 days [45.2]Smaller then1-5 days, 5-12 days ,13-25 days , 26-50 days
DGF&co (fdg) [3.4]DGF&co (fdg)
GEMINI PLC/THE [5.22], Leo CORP [23..0]GEMINI PLC/THE, Leo CORP
emptyempty

<colgroup><col style="width: 479px"><col width="349"></colgroup><tbody>
</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Use the Find and Select Option on the Ribbon on the Home Tab. Select Find and Replace. When prompted Find All and Replace All.
 
Upvote 0
No formula but try flash fill. Just enter one or two rows of example data in a column to the left and press CTRL-E
 
Upvote 0
try PowerQuery but this is not full automated

DATAMerged
ABC [2.5], JKB [23.3]ABC , JKB
Norway [.45]Norway
Smaller then1-5 days [12.5],5-12 days [34.5],13-25 days [23.3], 26-50 days [45.2]Smaller then1-5 days ,5-12 days ,13-25 days , 26-50 days
DGF&co (fdg) [3.4]DGF&co (fdg)
GEMINI PLC/THE [5.22], Leo CORP [23..0]GEMINI PLC/THE , Leo CORP

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Index = Table.AddIndexColumn(Source, "Index", 1, 1),
    Len = Table.AddColumn(Index, "Length", each Text.Length([DATA]), Int64.Type),
    Sort = Table.Sort(Len,{{"Length", Order.Descending}}),
    Split = Table.SplitColumn(Sort, "DATA", Splitter.SplitTextByAnyDelimiter({"[","]"}, QuoteStyle.Csv)),
    RC = Table.RemoveColumns(Split,{"DATA.2", "DATA.4", "DATA.6", "DATA.8", "DATA.9"}),
    Merge = Table.CombineColumns(RC,{"DATA.1", "DATA.3", "DATA.5", "DATA.7"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    Trim = Table.TransformColumns(Merge,{{"Merged", Text.Trim, type text}}),
    Sort2 = Table.Sort(Trim,{{"Index", Order.Ascending}}),
    RC2 = Table.RemoveColumns(Sort2,{"Index", "Length"})
in
    RC2[/SIZE]
 
Last edited:
Upvote 0
Cross posted https://chandoo.org/forum/threads/formula-needed-for-removal-of-and-data-in.41663/

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,239
Members
448,879
Latest member
VanGirl

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