+ Reply to Thread
Results 1 to 6 of 6

How to stop Long numbers from auto rounding...

Hybrid View

  1. #1
    Registered User
    Join Date
    01-27-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    3

    How to stop Long numbers from auto rounding...

    I am working on an inventory issue, we use a bar code scanner to read in inventory, and when we move inventory.
    One of our inventory items has a number that is 20-numerical characters long, Excel seems to convert the last 5 characters to zeros (0).
    Does anyone have a fix, or work around?

    An Example number would be: 89148000000286153971
    Excel changes the number to: 89148000000286100000

    Kind regards,

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to stop Long numbers from auto rounding...

    One way to is format the cells as text, another way is to add a ' in front of the values, saving them as text.

    Cheers

  3. #3
    Registered User
    Join Date
    01-27-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: How to stop Long numbers from auto rounding...

    Thank you. Formating as Text worked.
    Next question - as these numbers are so long, do you have a recommendation on how to break them up with dashes.
    I had originally formated the cells with Custom #####-######-#####-#### (we tend to use the last four numbers a lot, but need to be able to see the whole number.)

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to stop Long numbers from auto rounding...

    In that case you would need to format the text value directly for Excel not to round the number. Personally, I would use the whole number as is or perhaps use VBA to get the formatted barcode from the value saved as text (see below).

    Function FormatBarCode(rng As Range) As String
    
        If rng.Cells.Count > 1 Then Exit Function
        
        FormatBarCode = Format(rng.Value, "#####-######-#####-####")
        
    End Function
    and also,
    Function BarCodeFromFormat(rng As Range) As String
    
        If rng.Cells.Count > 1 Then Exit Function
        
        BarCodeFromFormat = Replace(rng.Value, "-", "")
        
    End Function

  5. #5
    Registered User
    Join Date
    01-27-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: How to stop Long numbers from auto rounding...

    Oh, very nice.

    Thank you very much.

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: How to stop Long numbers from auto rounding...

    Welcome to the forum Hogrider.


    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as "SOLVED".
    For the meantime I'll do it for you.

    How?
    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Note:
    You can also thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given.
    By doing so you can add to the reputation(s) of those who helped and shared their time in helping you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA function to STOP rounding numbers
    By evenings in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2010, 02:01 PM
  2. How do I stop excel from rounding numbers?
    By c-swym in forum Excel General
    Replies: 6
    Last Post: 06-15-2006, 09:10 PM
  3. [SOLVED] How do I stop numbers from rounding in Excel?
    By Josette_N in forum Excel General
    Replies: 10
    Last Post: 01-27-2006, 11:19 AM
  4. [SOLVED] the end of long numbers turn to 0s how do i stop that?
    By Shawna in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 11-21-2005, 03:25 PM
  5. How do I stop rounding numbers?
    By Jfeeman in forum Excel General
    Replies: 3
    Last Post: 03-16-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1