PDA

View Full Version : Remove only numeric value in the end of any string



LalitPandey87
04-02-2012, 07:59 AM
Hi All,

I have some data which is in text format. For ex.

abcd1
abcdes23
abgthygh456
abght6789
ab12
avhty190

need some formula which will remove only numeric value in the end of these text values.


Output will be like this

abcd
abcdes
abgthygh
abght
ab
avhty


Thanks in advance

Admin
04-02-2012, 08:03 AM
Hi,

One way would be

=REPLACE(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123465789")),LEN(A1),"")

Rick Rothstein
04-02-2012, 09:17 AM
Here is another formula that you can use...

=LEFT(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))-1)

NOTE: There appears to be a space in the list of digits in both my formula and the one Admin posted... there is no actual space in that text... for some reason, the text processor for this forum seems to randomly insert them for display only... if you copy/paste the formula, those spaces will not be copied (mainly because they are not really there).

LalitPandey87
04-08-2012, 09:39 AM
Thanks it's working. :cheers: