ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing the rightmost digit (https://www.excelbanter.com/excel-programming/286539-removing-rightmost-digit.html)

supersonicf111[_4_]

Removing the rightmost digit
 
I'm full of questions today, is there a way to remove the rightmost
digit from a list of numbers? Example below.


Original number

123456


Returned number

12345

Thanks in advance for your help!!!!


---
Message posted from http://www.ExcelForum.com/


Dan E[_3_]

Removing the rightmost digit
 
=--LEFT(A1,LEN(A1)-1)

Dan E

"supersonicf111" wrote in message ...
I'm full of questions today, is there a way to remove the rightmost
digit from a list of numbers? Example below.


Original number

123456


Returned number

12345

Thanks in advance for your help!!!!


---
Message posted from http://www.ExcelForum.com/




Steve Garman

Removing the rightmost digit
 
supersonicf111 wrote:
I'm full of questions today, is there a way to remove the rightmost
digit from a list of numbers? Example below.


Original number

123456


Returned number

12345

Thanks in advance for your help!!!!


Dim x As Long, y As Long
x = "123456"
y = Int(x / 10)
MsgBox y


--
Steve Garman


supersonicf111[_7_]

Removing the rightmost digit
 
As ussual, I left out too many details.

Dan,

I forgot to include that some of the numbers start with a letter like
below, while the others are just numbers.

D12334
123456

And Steve, I am not following you.


Sorry!
Brett


---
Message posted from http://www.ExcelForum.com/


Dan E[_3_]

Removing the rightmost digit
 
Brett,

Take off the "--" from the front of my formula. That was to force
the returned value to be a number. If all you need is a string
=LEFT(A1,LEN(A1)-1) should work

Dan E

"supersonicf111" wrote in message ...
As ussual, I left out too many details.

Dan,

I forgot to include that some of the numbers start with a letter like
below, while the others are just numbers.

D12334
123456

And Steve, I am not following you.


Sorry!
Brett


---
Message posted from http://www.ExcelForum.com/




supersonicf111[_8_]

Removing the rightmost digit
 
Dan,
Thanks, It works great!
Bret

--
Message posted from http://www.ExcelForum.com


Steve Garman

Removing the rightmost digit
 
supersonicf111 wrote:
As ussual, I left out too many details.

Dan,

I forgot to include that some of the numbers start with a letter like
below, while the others are just numbers.

D12334
123456

And Steve, I am not following you.


That's because I'd made all the wrong assumptions.

Because of the group you were posting in I thought you were looking for
a programming solution.

I also thought you were looking for a solution for numbers.

--
Steve Garman



All times are GMT +1. The time now is 10:16 PM.

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