Keep last 4 characters of value

G

Guest

Hi,

I need to remove the last 4 characters of value (b1).
I also need to remove all preceeding characters except the last 4 characters
of a value (c1)
Each value is of a different lenght.

IE

a1= 1234567890 (original value)
b1=123456
c1=7890

Thanks in advance,

AW
 
G

Guest

=right(a1,4) returns the last 4 digits but how do I get the text preceeding
the last 4 please?
 
R

Ron Rosenfeld

Hi,

I need to remove the last 4 characters of value (b1).
I also need to remove all preceeding characters except the last 4 characters
of a value (c1)
Each value is of a different lenght.

IE

a1= 1234567890 (original value)
b1=123456
c1=7890

Thanks in advance,

AW

B1: =RIGHT(A1,4)
or =MOD(A1,10000)

C1: =LEFT(A1,LEN(A1)-4)
or =INT(A1/10000)

The TEXT formula will return an error if LEN(A1) is not > 4; the Math formula
will return a "0" in that case.

It's not clear what result you want in those instances.

--ron
 
G

Guest

Not sure if I have understood this right but you could try this:

=LEFT(A1, LEN(A1)-4)

This will remove the last 4 characters from your cell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top