ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   if alpha character (https://www.excelbanter.com/excel-discussion-misc-queries/213888-if-alpha-character.html)

Samuel

if alpha character
 
The following cells:

00000000000A
00000000000B
00000000005


if right(a1)=alpha character then everything left of the character, else the
entire field.

How do I code this?

Gary''s Student

if alpha character
 
=IF(ISNUMBER(--RIGHT(A1,1)),A1,LEFT(A1,LEN(A1)-1))

--
Gary''s Student - gsnu200820


"samuel" wrote:

The following cells:

00000000000A
00000000000B
00000000005


if right(a1)=alpha character then everything left of the character, else the
entire field.

How do I code this?


David Biddulph[_2_]

if alpha character
 
=IF(CODE(RIGHT(A1))=65,LEFT(A1,LEN(A1)-1),A1)
--
David Biddulph

"samuel" wrote in message
...
The following cells:

00000000000A
00000000000B
00000000005


if right(a1)=alpha character then everything left of the character, else
the
entire field.

How do I code this?




Dave Peterson

if alpha character
 
One way using a formula in another cell:
=IF(ISNUMBER(-RIGHT(A1,1)),A1,LEFT(A1,LEN(A1)-1))

or to return a number (not text):
=--(IF(ISNUMBER(-RIGHT(A1,1)),A1,LEFT(A1,LEN(A1)-1)))

Not exactly what you asked, but probably sufficient????

samuel wrote:

The following cells:

00000000000A
00000000000B
00000000005

if right(a1)=alpha character then everything left of the character, else the
entire field.

How do I code this?


--

Dave Peterson

T. Valko

if alpha character
 
Another one...

Doesn't account for empty cells:

=LEFT(A1,LEN(A1)-ISERR(-RIGHT(A1)))

--
Biff
Microsoft Excel MVP


"samuel" wrote in message
...
The following cells:

00000000000A
00000000000B
00000000005


if right(a1)=alpha character then everything left of the character, else
the
entire field.

How do I code this?





All times are GMT +1. The time now is 08:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com