+ Reply to Thread
Results 1 to 9 of 9

####-####-####-#### - Last Digit Changes to '0'

  1. #1
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,054

    Question ####-####-####-#### - Last Digit Changes to '0'

    Hi,

    I have a bunch of cells with the, customized format: ####-####-####-####

    For whatever reasons, the last digit is being changed is being changed to '0'

    Why is this & more importantly - How to prevent?

    Thanks
    Last edited by mycon73; 11-22-2017 at 12:34 PM.
    MyCon
    -- Using Latest Version of Excel

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,825

    Re: ####-####-####-#### - Last Digit Changes to '0'

    Excel stores numbers as double precision, so it can only store numbers to about 15 digits (truncating additional digits). Solution is to store 16 digit or longer numbers as text strings and hope you don't need to do any calculations on them. This also means that you cannot use number formatting to "add" hyphens or other characters to the displayed number or stuff like that.

    My first thought is to get in the habit of including the "-" when you enter the number.
    If you don't want to do that, or the data are being read from a text file of some kind, you will need a formula (MID()) to pull the four character chunks and concatenate in the "-".
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: ####-####-####-#### - Last Digit Changes to '0'

    I am assuming that the cells that you are trying to format are numeric.

    Excel can only keep up to 15 significant digits. Notice that the 16th digit is the one changing to 0.

    See here for more:
    https://support.microsoft.com/en-us/...mbers-in-cells

  4. #4
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,054

    Re: ####-####-####-#### - Last Digit Changes to '0'

    Hi MrShorty,

    Thank for the quick feedback. Not sure what Double Precision is

    These "####-####-####-####" numbers are for Credit or Gift Cards because I'm tracking amounts given of how much money I save by earning FREE electricity

    Therefore, no calculations needed

    What's the solution to prevent last digit(s) to changing to '0'?

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: ####-####-####-#### - Last Digit Changes to '0'

    Change formatting from General or Number to Text.

  6. #6
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,054

    Re: ####-####-####-#### - Last Digit Changes to '0'

    Hi

    Using Custom Format, "####-####-####-####'

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: ####-####-####-#### - Last Digit Changes to '0'

    That custom format is attempting to take a numeric value and "custom format" it to show as ####-####-####-#### but the 16 digit number (which Excel can't handle precisely) will still be the value of the cell.

    Change the formatting of the cells from your Custom formatting to Text and then type in the credit card digits with the dashes exactly how you want them to look.

    e.g. format as Text and then type in 1234-5678-9012-3456

  8. #8
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,054

    Re: ####-####-####-#### - Last Digit Changes to '0'

    Wow!

    That's the only way Excel can handle this!!??

    OK....

    Thanks for the assistance...

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: ####-####-####-#### - Last Digit Changes to '0'

    Glad we could help.

    When you think about it, it makes sense that something like a credit card number, order number, ID, etc. should not be inputted as an actual number but rather as text with numeric digits in it.
    For example, it wouldn't make sense to say "1111-1111-1112-1111 is 10,000 more than 1111-1111-1111-1111" because credit card numbers do not have a numeric value.

    Also, it is important to understand the difference between a cell's formatting and the actual value that is in the cell.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Color a single digit in a mult-digit number cell
    By Phyllis in forum Excel General
    Replies: 8
    Last Post: 09-30-2022, 04:22 PM
  2. Bank Recon - How to convert 8 digit formatted check numbers to 6 digit
    By Quisp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2017, 09:55 PM
  3. [SOLVED] LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 12:57 AM
  4. Replies: 20
    Last Post: 09-29-2012, 08:45 PM
  5. Replies: 2
    Last Post: 06-17-2010, 08:36 PM
  6. Wierd - last digit gets changed to zero
    By Litlwillie in forum Excel General
    Replies: 10
    Last Post: 05-07-2009, 08:59 PM
  7. [SOLVED] last digit in string gets changed to 0 (16 characters long)
    By Mike Milmoe in forum Excel General
    Replies: 3
    Last Post: 06-29-2005, 11:05 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