delete any word inside [ ] in excel with formula

deeproject

New Member
Joined
Oct 26, 2016
Messages
10
hi,

i have database with various word inside [ ] , i want to delete every last of them but keep the other word.
i been searching in web for hours but cant find it,

fot instance i have data like bellow

Kayu Putih Rw 13 Kel Kayu Putih Kec Pulogadung [Permit Reject To Be Dismental Tiang Icon+]

<tbody>
</tbody>
Pemukiman Rw 02 Kel Cilandak Barat Kec Cilandak [Area 70% Digusur Untuk Jalan Tol] [Permit By Inhouse : 26 09 2016]

<tbody>
</tbody>
i want to clean up to

Kayu Putih Rw 13 Kel Kayu Putih Kec Pulogadung
Pemukiman Rw 02 Kel Cilandak Barat Kec Cilandak

is there any formula to do it since the data about 1500

any help will be appreciated.

thankyou

<tbody>
</tbody>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Isn't this a simple Find and Replace?

Find what: [*]
Replace:

Replace with nothing
 
Upvote 0
It may be easier to use Text to Columns with delimiter option Other "[" to split the text out into columns to keep/delete
 
Upvote 0
Code:
On Error Resume Next
With Workbooks("NAME").Worksheets("NAME") 'change

For each Cell in .Range("A1:A1500") 'change
If err.number = 0 Then
charn = Instr(1, Cell.Value, "[")
Cell.Value = Left(Cell.Value, Len(Cell.Value)-(Len(Cell.Value)-charn))

End if
Next Cell

End With

This code does assume that there is no text that needs to be saved after the first "[", so take that in mind. If this is a wrong assumption, let me know
 
Last edited:
Upvote 0
It seems the bracketed text is always at the end of the cell so you could use:

=TRIM(LEFT(A1,IFERROR(FIND("[",A1)-1,LEN(A1))))
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,559
Members
448,970
Latest member
kennimack

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