+ Reply to Thread
Results 1 to 4 of 4

Change general format to US date format

Hybrid View

woodlot4 Change general format to US... 10-10-2005, 03:57 PM
Guest Re: Change general format to... 10-10-2005, 05:05 PM
Guest Hi, Came up with the same... 10-10-2005, 05:20 PM
Guest Re: Change general format to... 10-10-2005, 08:05 PM
  1. #1
    Registered User
    Join Date
    08-24-2005
    Posts
    6

    Change general format to US date format

    I have a list of contacts with data. One of the columns is for "date". However, ONe of the lists I have has the date formatted as "general" and when I try to format it as date it puts the wrong number in it.
    Example: column G reads 10298 which is the date 01/02/1998. No matter what I try I cannot get it to read as a date. Please help. I have searched the forum over and over and cannot find the answer to this issue. My anxiety is through the roof!
    email help to woodlot4 at yahoo.com

  2. #2
    Dave O
    Guest

    Re: Change general format to US date format

    Because the cell is formatted as General, Excel perceives the entry to
    be an integer number and trims off the leading zero. If you dig the
    mm/dd/yy date format, you can use this formula in a new column to parse
    the 10298 into an Excel date:

    =IF(LEN(A1)=5,LEFT(A1,1)&"/"&MID(A1,2,2)&"/"&RIGHT(A1,2),LEFT(A1,2)&"/"&MID(A1,3,2)&"/"&RIGHT(A1,2))

    .... where A1 contains the 10298. This formula checks the length of the
    entry and parses accordingly.


  3. #3
    pinmaster
    Guest
    Hi,
    Came up with the same answer as Dave but with a slight ajustment.
    =IF(LEN(G1)=5,ABS(LEFT(G1,1)&"/"&MID(G1,2,2)&"/"&RIGHT(G1,2)),ABS(LEFT(G1,2)&"/"&MID(G1,3,2)&"/"&RIGHT(G1,2)))

    Cheers!
    JG

  4. #4
    David McRitchie
    Guest

    Re: Change general format to US date format

    You should be feeding year, month, day into DATE Worksheet Function.
    In VBA you would feed into DateSerial
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm



+ 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