Alternative to Textbefore Function

NorthbyNorthwest

Board Regular
Joined
Oct 27, 2013
Messages
154
Office Version
  1. 365
Hi, everyone. I created a workbook for another person's use. The workbook includes the new textbefore function. Unfortunately, it appears the user's version of Excel does not support this function. The formula is as follows:
=TEXTBEFORE(E4," (",-1,,,E4)

The workbook has a list of names followed by unneeded remark in parentheses. Example" SMITH, JOHN A (1234). The formula above removed (1234). Is there older function or combination of older functions I can use to achieve the same result? Note the remark in parentheses varies in length. It isn't always four characters within the parentheses or six characters including parentheses.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
how about
=LEFT(E4,FIND("(",E4,1)-1)
 
Upvote 0
how about
=LEFT(E4,FIND("(",E4,1)-1)
Thanks, etaf. Left worked perfectly. I have a second formula in the workbook that cleans up names by removing a hyphen and everything that follows after the last and first names. I tried swapping out the parentheses in your formula with a hyphen. I got a VALUE error. Could you help with this too?
 
Upvote 0
an example would help

also Dave Patton provided the same answer

how about

Book2
EF
1
2
3
4 SMITH, JOHN A (1234 SMITH, JOHN A
5 SMITH, JOHN A - (1235 SMITH, JOHN A
Sheet1
Cell Formulas
RangeFormula
F4F4=LEFT(E4,SEARCH("(",E4,1)-1)
F5F5=LEFT(E5,SEARCH("-",E5,1)-1)
 
Upvote 0
Solution
an example would help

also Dave Patton provided the same answer

how about

Book2
EF
1
2
3
4 SMITH, JOHN A (1234 SMITH, JOHN A
5 SMITH, JOHN A - (1235 SMITH, JOHN A
Sheet1
Cell Formulas
RangeFormula
F4F4=LEFT(E4,SEARCH("(",E4,1)-1)
F5F5=LEFT(E5,SEARCH("-",E5,1)-1)
Example: SMITH, JOHN A - 1234
I also want to get rid of the hyphen and what follows. I tried using the left function as you did. It removed the "1234" but not the hyphen or space following the hyphen.
 
Upvote 0
has in my example
E5

=LEFT(E4,SEARCH("-",E4,1)-1)

to get rid of any trailing spaces
=TRIM(LEFT(E4,SEARCH("-",E4,1)-1))

Book2
EF
1
2
3
4 SMITH, JOHN A (1234 SMITH, JOHN A
5 SMITH, JOHN A - (1235 SMITH, JOHN A
6
7
8SMITH, JOHN A - 1234SMITH, JOHN A
Sheet1
Cell Formulas
RangeFormula
F4F4=LEFT(E4,SEARCH("(",E4,1)-1)
F5F5=LEFT(E5,SEARCH("-",E5,1)-1)
F8F8=TRIM(LEFT(E8,SEARCH("-",E8,1)-1))
 
Upvote 0
has in my example
E5

=LEFT(E4,SEARCH("-",E4,1)-1)

to get rid of any trailing spaces
=TRIM(LEFT(E4,SEARCH("-",E4,1)-1))

Book2
EF
1
2
3
4 SMITH, JOHN A (1234 SMITH, JOHN A
5 SMITH, JOHN A - (1235 SMITH, JOHN A
6
7
8SMITH, JOHN A - 1234 SMITH, JOHN A
Sheet1
Cell Formulas
RangeFormula
F4F4=LEFT(E4,SEARCH("(",E4,1)-1)
F5F5=LEFT(E5,SEARCH("-",E5,1)-1)
F8F8=TRIM(LEFT(E5,SEARCH("-",E5,1)-1))
Yes that worked too. Thanks again, etaf.
try

T202301a.xlsm
EFG
1
2
3
4SMITH, JOHN A (1234)SMITH, JOHN A
5
1b
Cell Formulas
RangeFormula
F4F4=LEFT(E4,FIND("(",E4)-1)
Thanks for the response, Dave. Appreciate all.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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