Varying LEFT Function

John_Wh

Board Regular
Joined
Feb 26, 2013
Messages
59
In column A I have varying input data that I need to adjust. I'm trying to eliminate the parentheses and the 1 or 2 digit numbers within.

Column A I've got data like

15 C.Smith(5)
9 F.Forsberg(12)

etc. the number in the parentheses increases as the season progresses.

In column B I'm wanting the result to be

15 C.Smith
9 F.Forsberg

I'm using this function but have to alter it as the number in parentheses increases.

=LEFT(A1, LEN(A1)-3) which works well with one digit in the parenthesis but have to manually change the formula to =LEFT(A1, LEN(A1)-4) when 2 digits are in the parenthesis.

What is one formula that covers both conditions (1 or 2 digits in the parenthesis) I do not expect to ever have 3 digits in the parenthesis.

Thanks
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Try:

=LEFT(A1,FIND("(",A1&"(")-1)
 

John_Wh

Board Regular
Joined
Feb 26, 2013
Messages
59
Thanks guys

Both work fine.

Fluff has responded a few times regarding this hockey spreadsheet and just a few minutes ago regarding something else on it.

Wish I could buy all the mods a beverage of their choice. Hope you get the satisfaction of helping as much as those you help!
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS

Forum statistics

Threads
1,077,823
Messages
5,336,569
Members
399,088
Latest member
Swindlestikz

Some videos you may like

This Week's Hot Topics

Top