Greetings,
I have the following formula: =LEFT(A2,FIND("-",A2)-1). This works fine, except when I have a string such as 2345-1234-56789
I need to extract the first and second part of the string... 2345-1234. These could be more characters or fewer in each part between the dash, but the condition exists with having two dash's.
Thanks,
Brad
Help with =LEFT Formula
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
-
- Administrator
- Posts: 78485
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Help with =LEFT Formula
Try
=TRIM(LEFT(SUBSTITUTE(A2, "-", REPT(" ", 255), 2), 255))
=TRIM(LEFT(SUBSTITUTE(A2, "-", REPT(" ", 255), 2), 255))
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Help with =LEFT Formula
Nice!
Thanks.
Thanks.
-
- 4StarLounger
- Posts: 575
- Joined: 14 Nov 2012, 16:06
Re: Help with =LEFT Formula
=LEFT(A1;FIND("-";A1;FIND("-";A1)+1)-1)
-
- 5StarLounger
- Posts: 817
- Joined: 24 Jan 2010, 15:56
Re: Help with =LEFT Formula
If you have a current version of 365:
=TEXTBEFORE(A2,"-",2)
=TEXTBEFORE(A2,"-",2)
Regards,
Rory
Rory
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Help with =LEFT Formula
Tried them all. ALl worked. Thanks!!