ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Leading Zero and the change command (https://www.excelbanter.com/excel-worksheet-functions/145523-leading-zero-change-command.html)

mmccoog

Leading Zero and the change command
 
My data is preceeded by "." up to "........" When I use the change command to
delete the ".", it also drops any leading zeros in the text. The field is
formatted as text and the data is not proceeded by a single quote.
Ex. ...01263 changes to 1263. Any ideas why this would happen?

Pete_UK

Leading Zero and the change command
 
When you get rid of the leading full-stops and are left with 01263,
then Excel will treat this as if you typed it in - it comprises only
numeric characters, therefore it must be a number, and any leading
zeroes can therefore be ignored (Excel's logic).

If all your numbers are to be 5 digits in length, then you could use

=RIGHT(A1,5)

or alternatively you could apply a custom format to the cells, but you
will need to give a few more details concerning the variations in your
numbers if you want a more complete answer.

Hope this helps.

Pete

On Jun 6, 10:46 pm, mmccoog wrote:
My data is preceeded by "." up to "........" When I use the change command to
delete the ".", it also drops any leading zeros in the text. The field is
formatted as text and the data is not proceeded by a single quote.
Ex. ...01263 changes to 1263. Any ideas why this would happen?




mmccoog

Leading Zero and the change command
 
Thanks Pete. My data is various lengths so instead of deleting the '.', I
changed it to a single quote and that did the trick. Thanks for your response.
Mary Ann

"Pete_UK" wrote:

When you get rid of the leading full-stops and are left with 01263,
then Excel will treat this as if you typed it in - it comprises only
numeric characters, therefore it must be a number, and any leading
zeroes can therefore be ignored (Excel's logic).

If all your numbers are to be 5 digits in length, then you could use

=RIGHT(A1,5)

or alternatively you could apply a custom format to the cells, but you
will need to give a few more details concerning the variations in your
numbers if you want a more complete answer.

Hope this helps.

Pete

On Jun 6, 10:46 pm, mmccoog wrote:
My data is preceeded by "." up to "........" When I use the change command to
delete the ".", it also drops any leading zeros in the text. The field is
formatted as text and the data is not proceeded by a single quote.
Ex. ...01263 changes to 1263. Any ideas why this would happen?






All times are GMT +1. The time now is 06:48 PM.

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