SOLVED

How do I remove the first and last number from a 5-digit number?

Occasional Contributor

So I know if I want to remove the last digit of a 5-digit number, I use the formula:

=LEFT(C2,4) C2 being the cell I am affecting.

In the case of the number 01234 being in cell C2, my formula would give me the first 4 digits only, or 0123.

 

Question: How do I remove the first digit and the last digit, so I just end up with 123?

 

Thank you!

4 Replies

@Danger_SF Try this:

=MID(C2,2,LEN(C2)-2)

 

best response confirmed by Danger_SF (Occasional Contributor)
Solution

@Danger_SF 

 

 

=MID(TEXT(C2,"00000"),2,3)

 

 

EDIT:

Without any text function.

=MOD(QUOTIENT(C2,10),1,000)

 

@Danger_SF 

Another variant of @Detlef Lewin formula

=INT( MOD(A1,10000) / 10 )