This have on a1
CL712BG
CL712BG
CL712BG
CL712BG
CL712BG
CL712BR
CL712BR
CL712BR
CL712BR
CL712BR
Want
CL712
CL712
CL712
CL712
CL712
CL712
CL712
CL712
CL712
CL712
This have on a1
CL712BG
CL712BG
CL712BG
CL712BG
CL712BG
CL712BR
CL712BR
CL712BR
CL712BR
CL712BR
Want
CL712
CL712
CL712
CL712
CL712
CL712
CL712
CL712
CL712
CL712
Is that a consistent format?
You could just do
=LEFT(A1,5)
This may not work as character could not be same
Hi All,
a possible formula:
=LEFT(A1,MAX(INDEX(ISNUMBER(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))*ROW(INDIRECT("1:"&LEN(A1))),0)))
Hope it helps
-----------------------------------------------------
At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.
Please, mark your thread [SOLVED] if you received your answer.
Can you give a more complete sample set of data, that shows all possible formats?
=iferror(left(a1,lookup(2,1/(mid(a1,row(indirect("1:"&len(a1))),1)),row(indirect("1:"&len(a1))))),a1)![]()
Please Login or Register to view this content.
Samba
Say thanks to those who have helped you by clicking Add Reputation star.
Assumes every cell will contain a single string of digits.
=LEFT(A1,LOOKUP(10,--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),ROW(INDIRECT("1:"&LEN(A1)))))
Biff
Microsoft MVP Excel
Keep It Simple Stupid
Let's Go Pens. We Want The Cup.
In general, (for any cases with mixture of values and strings, i think)
=LEFT(A1,LEN(A1)+1-MATCH(TRUE,ISNUMBER(--MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1)),0))
...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
Quang PT
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks