+ Reply to Thread
Results 1 to 20 of 20

Date/Time Function in Excel (Day/Month/Year & time)

  1. #1
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Date/Time Function in Excel (Day/Month/Year & time)

    Hello,

    I need assistance, please (anyone!!).
    I have a spreadsheet where I have run a query and pulled an export to Excel. The report is very simple (below). Basically, I am trying to convert the second column from Day/Month/Year to Month/Day/YEAR with the allocated time listed. If I go and paste this information into excel (since it is an export) there are constraints in the cell that do not allow me to do the general format options and change the column into the correct format. Nothing works.
    Any help here?

    Created Updated Resolved
    12/13/2011 13/12/11 16:07 12/13/2011 0:04:00

  2. #2
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Sorry to make it clear...
    my column is
    A = 12/13/11
    B = 13/12/11 16:07
    C = 12/13/11
    D= 0:04:00

    The focus is column B -- It will not convert

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Possibly there's an easier way...but you can add a temporary helper column formula:

    =DATE("20"&MID(B2,7,2),MID(B2,4,2),LEFT(B2,2))+TIME(MID(B2,FIND(" ",B2)+1,2),RIGHT(B2,2),0)

    copied down

    then copy and paste special|values over the original.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Wow!!!
    That worked.. so I have to do that into another cell... so that the dates are transformed!!
    Wow!!!
    Thank you!

  5. #5
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Okay.. NOt working..
    Help...

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Excel is seeing that combination as a text string and therefore you can't "reformat" as date.

    An alternative that you can try, if you don't mind splitting the date and time into 2 separate columns...

    First, insert a column before column C.

    Then select column B and go to Data|Text to Columns.

    Select Delimited, click Next,
    Select Space checkbox, and click Next,
    Select Date radio button from the column data format area and then select DMY from the adjacent drop down
    Click Finish.

    You can re-combine the date and time again after, if desired.

  7. #7
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Would it be easier to post a copy of the spreadsheet?

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Try above, if feasible first, then if not, post the worksheet, void of confidential info.

  9. #9
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    See attached.
    The focus is Column J, K, L.
    Should be easy but not sure why it isn't working.
    Attached Files Attached Files

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    When I open your workbook, all 3 cells show up as proper dates and time... all showing 9/12/2011 and a time.. and they are all formatted as custom: m/d/yyyy h:mm

    Dates isn't one of my strong suits... especially in translation from UK to US formats... so not sure what the issue is.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    If still trouble and you don't want to do the Text to Columns, try helper formula adjusted:

    =DATE(MID(K2,7,4),MID(K2,4,2),LEFT(K2,2))+TIME(MID(K2,FIND(" ",K2)+1,2),RIGHT(K2,2),0)

  12. #12
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    No... The dates are wrong... it is in DAY/MONTH/YEAR format...
    I need them in
    "MONTH" / "DAY" / "YEAR" format...
    So what was mentioned 9/12/11 --- that should be December 9, 2011 --- the system is coverting it once it is extracted to Excel.
    That is my entire problem.
    Help!

  13. #13
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    I should have posted a different example

    Please see attached.
    Attached Files Attached Files

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Well this original formula worked for me to convert that to November 28th:

    =DATE("20"&MID(K2,7,2),MID(K2,4,2),LEFT(K2,2))+TIME(MID(K2,FIND(" ",K2)+1,2),RIGHT(K2,2),0)

  15. #15
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    I tried =DATE(MID(K2,7,4),MID(K2,4,2),LEFT(K2,2))+TIME(MID(K2,FIND(" ",K2)+1,2),RIGHT(K2,2),0)

    in the spreadsheet and it does not work.
    Please open the attachment and see if you are able to do it. It does not work.

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Check formula in CI2. Does it not appear right?

    Alternatively have a look at how something similar was resolved here: http://www.excelforum.com/excel-gene...te-format.html
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    Yes, this formual works : DATE("20"&MID(B4,7,2),MID(B4,4,2),LEFT(B4,2))+TIME(MID(B4,FIND(" ",B4)+1,2),RIGHT(B4,2),0)
    However, it takes out the time? How can I add the time in the column back in there?

  18. #18
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    To addk to the above...
    when I use: DATE("20"&MID(B4,7,2),MID(B4,4,2),LEFT(B4,2))+TIME(MID(B4,FIND(" ",B4)+1,2),RIGHT(B4,2),0)
    it works in some fields and in others it does not... because the dates show up as 1/12/11 but it should be 12/1/11. Also, the times do not populate.
    Is there a way that it can get populated correctly.
    I basically have 500+ rows.. where dates are listed as DD/MM/YY--- and some are showing up as 1/12/11 but it should show up as 12/1/11 - when I use DATE("20"&MID(B4,7,2),MID(B4,4,2),LEFT(B4,2))+TIME(MID(B4,FIND(" ",B4)+1,2),RIGHT(B4,2),0) it tells me I have an error in my cell. Also, my time range is not being captured.
    Is it possible to fix?

  19. #19
    Registered User
    Join Date
    09-18-2007
    Posts
    53

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    another attachment with the two examples.
    Sorry!
    I appreciate everyone's help here.
    Just need to figure out how to solve this.. and carry the time's in the same cell.
    Attached Files Attached Files

  20. #20
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Date/Time Function in Excel (Day/Month/Year & time)

    You can use a UDF with a helper column:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ben Van Johnson

+ 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