Have several cells in a column that at the end of the sentence have a sentence inside of ( )
Ex. Hello World (wwfx fgty jkilo)
The output desire is Hello World ()
Have several cells in a column that at the end of the sentence have a sentence inside of ( )
Ex. Hello World (wwfx fgty jkilo)
The output desire is Hello World ()
You can use 'match' to do this. The awkward bit is making sure you deal with both the situation where there are brackets and where there are not brackets successfully.
Using match:
with(value.match(/(.*)\(.*\)/)[0],w,if(isNonBlank(w),w+"()",value))
This extracts everything before the last open bracket in the string. If there is no open bracket then it just uses the original value
The answer without using regex:
(
)
value.split('(')[0]+'()'+value.split(')')[-1]
where
value.split('(')[0]
selects everything before the first (
value.split(')')[-1]
selects everything after the last )
+'()'+
()