+ Reply to Thread
Results 1 to 3 of 3

Date Format

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    pendleton, nc
    MS-Off Ver
    windows 7
    Posts
    2

    Date Format

    I would like to be able to key in 02142019 and cell read 2019-02-14. I have been able to enter a custom format that will enter the dashes but cant figure out how to change the order of the entry.

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

    Re: Date Format

    What are you wanting to do with these dates? If you want Excel to recognize them as dates -- so you can use number formatting to format the dates in different ways and use Excel's date functions to manipulate the dates, then the easiest is to probably use text manipulation functions to extract the parts of the date and then convert to date serial number.

    Read something like this to understand how Excel stores dates (and time) as serial numbers: http://www.cpearson.com/Excel/datetime.htm

    I would probably:

    1) preformat the data entry cell as text so that Excel will retain the leading 0 and store my date string as a text string and not a number.
    2) Enter my dates 02142019 like you propose.
    3) Have an adjacent helper column that will convert the text to an Excel date:
    3a) Use a RIGHT() function to get the year RIGHT(A1,4)
    3b) Use a LEFT() function to get the month LEFT(A1,4)
    3c) Use a MID() function to get the day MID(A1,3,2)
    3d) Finally use a DATE() function to combine those parts of the date into a single date serial number. =DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3,2))
    4) Format the date in the desired number/date format -- "yyyy-mm-dd" custom number format help file: https://support.office.com/en-us/art...7-9c9354dd99f5
    5) optional -- if you dislike having both cells, then copy the formula cell -> paste special -> as values over the data entry cell. You can then delete the formula cell. I would only do this if this is a one time or rare thing -- since the copy paste -- delete operation will delete the formula. If this is going to be a frequent thing, then I would keep the formula cell.

    Help files for all functions can be found here, in their appropriate category: https://support.office.com/en-us/art...1-63f26a86c0eb

    Is that an adequate solution?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    02-22-2019
    Location
    pendleton, nc
    MS-Off Ver
    windows 7
    Posts
    2

    Re: Date Format

    That worked perfectly!! Thank you so much!!

+ 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. Converting from the 1904 date format to the 1900 date format without losing data
    By Patty McJorst in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-01-2020, 12:53 PM
  2. [SOLVED] Converting Date & Time (General format) to Date (Date format)
    By supremenuts in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2017, 12:55 PM
  3. Replies: 4
    Last Post: 04-29-2015, 08:36 AM
  4. Date Format Of User PC Changes Display format date of Excel File after update
    By waihar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2014, 03:09 AM
  5. Replies: 5
    Last Post: 02-08-2013, 11:06 AM
  6. Need Formula/VBA Code to convert date in String Format to Normal Date format
    By Karthik Sen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2012, 04:54 AM
  7. Column Range with date Format MM/DD/YYYY independate of sys date Format
    By gaursh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2011, 03:31 AM

Tags for this Thread

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