+ Reply to Thread
Results 1 to 3 of 3

Date format (xx/xx/xxxx) not recognized?

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Date format (xx/xx/xxxx) not recognized?

    Sorry for what is probably a very stupid question, but excel is driving me crazy.

    I've imported a data set that is published by state, and I want to use a SUMIF function to aggregate the data by date. However, no matter how many permutations I've tried, I can't find a date format that excel will accept.

    So far, I've gotten the date into the format mm/dd/yyyy. I've also cut and paste the dates as values only (in case any formulas were getting in the way), and changed the cell formats to "Date".

    Unfortunately, the dates are still only recognized as general text.

    What else do I have to do?

    Note: The DATEVALUE function returns a #VALUE! error.

  2. #2
    Registered User
    Join Date
    04-04-2013
    Location
    Northampton
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Date format (xx/xx/xxxx) not recognized?

    Hi Sybil,
    This explains the various formats for date & time, one should meet your criterior.

    Visual Basic 6 (VB6)
    Written By TheVBProgramer.
    In addition to the named date/time formats described previously, you can also create custom date/time formats using a combination of specific characters recognized by the Format$ function, shown in the table below:

    Format Character(s)


    Description

    := Time separator. In some locales, other characters may be used to represent the time separator. The time separator separates hours, minutes, and seconds when time values are formatted. The actual character used as the time separator in formatted output is determined by your system settings.

    /= Date separator. In some locales, other characters may be used to represent the date separator. The date separator separates the day, month, and year when date values are formatted. The actual character used as the date separator in formatted output is determined by your system settings.

    C= Display the date as ddddd and display the time as t t t t t, in that order. Display only date information if there is no fractional part to the date serial number; display only time information if there is no integer portion.

    d= Display the day as a number without a leading zero (1 - 31).

    dd= Display the day as a number with a leading zero (01 - 31).

    ddd= Display the day as an abbreviation (Sun - Sat).

    dddd= Display the day as a full name (Sunday - Saturday).

    ddddd= Display the date as a complete date (including day, month, and year), formatted according to your system's short date format setting. The default short date format is m/d/yy.

    dddddd= Display a date serial number as a complete date (including day, month, and year) formatted according to the long date setting recognized by your system. The default long date format is mmmm dd, yyyy.

    w= Display the day of the week as a number (1 for Sunday through 7 for Saturday).

    ww= Display the week of the year as a number (1 - 53).

    m= Display the month as a number without a leading zero (1 - 12). If m immediately follows h or hh, the minute rather than the month is displayed.

    mm= Display the month as a number with a leading zero (01 - 12). If m immediately follows h or hh, the minute rather than the month is displayed.

    mmm= Display the month as an abbreviation (Jan - Dec).

    mmmm= Display the month as a full month name (January - December).

    q= Display the quarter of the year as a number (1 - 4).

    y= Display the day of the year as a number (1 - 366).

    yy= Display the year as a 2-digit number (00 - 99).

    yyyy= Display the year as a 4-digit number (100 - 9999).

    h= Display the hour as a number without leading zeros (0 - 23).

    hh= Display the hour as a number with leading zeros (00 - 23).

    n= Display the minute as a number without leading zeros (0 - 59).

    nn= Display the minute as a number with leading zeros (00 - 59).

    s= Display the second as a number without leading zeros (0 - 59).

    ss= Display the second as a number with leading zeros (00 - 59).

    t t t t t= Display a time as a complete time (including hour, minute, and second), formatted using the time separator defined by the time format recognized by your system. A leading zero is displayed if the leading zero option is selected and the time is before 10:00 A.M. or P.M. The default time format is h:mm:ss.

    AM/PM= Use the 12-hour clock and display an uppercase AM with any hour before noon; display an uppercase PM with any hour between noon and 11:59 P.M.

    am/pm= Use the 12-hour clock and display a lowercase AM with any hour before noon; display a lowercase PM with any hour between noon and 11:59 P.M.

    A/P= Use the 12-hour clock and display an uppercase A with any hour before noon; display an uppercase P with any hour between noon and 11:59 P.M.

    a/p= Use the 12-hour clock and display a lowercase A with any hour before noon; display a lowercase P with any hour between noon and 11:59 P.M.

    AMPM= Use the 12-hour clock and display the AM string literal as defined by your system with any hour before noon; display the PM string literal as defined by your system with any hour between noon and 11:59 P.M. AMPM can be either uppercase or lowercase, but the case of the string displayed matches the string as defined by your system settings. The default format is AM/PM.

    To demonstrate custom numeric formats using combinations of the characters listed above, set up another "Try It" project, and place the following code in the cmdTryIt_Click event:



    Private Sub cmdTryIt_Click()



    Print "Using 'm/d/yy':"; Tab(30); Format$(Now, "m/d/yy")

    Print "Using 'mm/dd/yyyy':"; Tab(30); Format$(Now, "mm/dd/yyyy")

    Print "Using 'yyyy-mm-dd':"; Tab(30); Format$(Now, "yyyy-mm-dd")

    Print "Using 'dddd, mmmm dd, yyyy':"; Tab(30); Format$(Now, "dddd, mmmm dd, yyyy")

    Print "Using 'd-mmm':"; Tab(30); Format$(Now, "d-mmm")

    Print "Using 'mmmm-yy':"; Tab(30); Format$(Now, "mmmm-yy")

    Print "Using 'hh:mm AM/PM':"; Tab(30); Format$(Now, "hh:mm AM/PM")

    Print "Using 'h:mm:ss a/p':"; Tab(30); Format$(Now, "h:mm:ss a/p")

    Print "Using 'd-mmmm h:mm':"; Tab(30); Format$(Now, "d-mmmm h:mm")

    Print "Using 'd-mmmm-yy':"; Tab(30); Format$(Now, "d-mmmm-yy")

    Print "Using 'd mmmm':"; Tab(30); Format$(Now, "d mmmm")

    Print "Using 'mmmm yy':"; Tab(30); Format$(Now, "mmmm yy")

    Print "Using 'hh:mm AM/PM':"; Tab(30); Format$(Now, "hh:mm AM/PM")

    Print "Using 'h:mm:ss a/p':"; Tab(30); Format$(Now, "h:mm:ss a/p")

    Print "Using 'h:mm':"; Tab(30); Format$(Now, "h:mm")

    Print "Using 'h:mm:ss':"; Tab(30); Format$(Now, "h:mm:ss")

    Print "Using 'm/d/yy h:mm':"; Tab(30); Format$(Now, "m/d/yy h:mm")

    End Sub



    Run the project and click the "Try It" button. The current date and/or time, formatted in the various ways, will be displayed on your form:


    Best regards
    Robbosan

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.83 for Mac MS 365
    Posts
    8,480

    Re: Date format (xx/xx/xxxx) not recognized?

    Sybil, welcome to the forum. You may have to post an example so people here can see what is going on, otherwise forum participants may not be able to reproduce what you are seeing to try to trouble shoot it.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

+ 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. Turning '20121101' into recognized date format
    By roykosghost in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-06-2012, 07:47 PM
  2. [SOLVED] Date format not recognized
    By matt3m in forum Excel General
    Replies: 4
    Last Post: 09-06-2012, 07:59 AM
  3. Replies: 3
    Last Post: 08-06-2009, 03:02 PM
  4. Replies: 1
    Last Post: 07-01-2005, 06:05 PM
  5. Replies: 1
    Last Post: 03-21-2005, 01:06 PM

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