Leading Zeros
I figured it out
you
had=RIGHT(A1,LEN(A1)+1-MATCH(FALSE,INDEX(MID(A1,ROW($A$1:INDEX($A:$A,LEN( A1),1)),1)="0",0),0))
I had
=RIGHT(E1,LEN(AE1)+1-MATCH(FALSE,INDEX(MID(E1,ROW($E$1:INDEX($E:$E,LEN( E1),1)),1)="0",0),0))
should be
=RIGHT(E1,LEN(E1)+1-MATCH(FALSE,INDEX(MID(E1,ROW($A$1:INDEX($A:$A,LEN( E1),1)),1)="0",0),0))
"Ron Coderre" wrote:
This is my formula for cell B1:
=RIGHT(A1,LEN(A1)+1-MATCH(FALSE,INDEX(MID(A1,ROW($A$1:INDEX($A:$A,LEN( A1),1)),1)="0",0),0))
Note: In case text-wrap impacts the display, there are no spaces in that
formula.
Using your data, this is what the formulas are returning:
Orig value Formula result
00013623 13623
e3000211 e3000211
00005629 5629
It's seeming like a data issue is causing you to get different results.
Check the source cells carefully....Is anything odd there that I'm not
catching?
***********
Regards,
Ron
XL2003, WinXP
"Ben Watts" wrote:
Almost, this what I had in my 1st 3 cells
00013623
e3000211
00005629
This is what I got with your formula
013623
e3000211
05629
It left a zero at the beginning, I need to get rid of that. Thanks, that
was still awesome.
"Ron Coderre" wrote:
If A1 contains the string to be altered
Example:
A1: 00asdf20
Perhaps this formula in a helper column:
B1:
=RIGHT(A1,LEN(A1)+1-MATCH(FALSE,INDEX(MID(A1,ROW($A$1:INDEX($A:$A,LEN( A1),1)),1)="0",0),0))
In the above example, B1 returns: asdf20
That formula is durable against blank cells, numeric cells, and cells with
no leading zeros.
Is that something you can work with?
***********
Regards,
Ron
XL2003, WinXP
"Ben Watts" wrote:
I have a column that has leading zeros. I want to get rid of all leading
zeros. Some have 3, some have 2...etc....SOme of the cells have letters in
them also. SO what can I do? Thanks
|