+ Reply to Thread
Results 1 to 6 of 6

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

+ 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