+ Reply to Thread
Results 1 to 7 of 7

How do I add a leading zero to a date?

  1. #1
    Registered User
    Join Date
    02-26-2007
    Posts
    3

    How do I add a leading zero to a date?

    I have imported a DBF file into Excel and have a column of dates that are missing the leading zero on single didgit months. When I try to us the custom format of mm/dd/yyyy it doesn't work (interestingly, after I select that format if I click on an individual cell it changes to the right format).

    Does anyone know a better way to do this?

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    try this:

    format the column to the format that you want. Then highlight all of the dates>copy>paste special>values (into the same cell range). They should be the correct format

  3. #3
    Registered User
    Join Date
    02-26-2007
    Posts
    3
    Unfortunately, that doesn't seem to work. It stays the same. It will change format while clicking on the individual cell, but there are roughly 8000 rows that need to be modified.

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    ok. It seems that your dates are formatted as text. This is what you should do.

    first, on a blank cell somewhere on the sheet, type the number 1. then, right click, copy.
    next, highlight the entire column of dates. right click, paste special, multiply.
    all of the dates will have turned into numbers.
    next, highlight the date column, and apply the date format that you want.

    let me know if it works

  5. #5
    Registered User
    Join Date
    02-26-2007
    Posts
    3
    Like a charm! Nice trick, thanks very much!!!

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Glad it worked out for you

  7. #7
    Registered User
    Join Date
    12-08-2015
    Location
    San Diego, CA, United States
    MS-Off Ver
    2010
    Posts
    2

    Re: How do I add a leading zero to a date?

    Thank you BigBas, this was very helpful to me too! I got it to work easily. I frequently have to reconcile dates in US format to European format and there is always some little bug in the formatting that makes me have to do them 1-by-1, ugh! This trick will get lots of use! Many thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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