+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

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

  1. #16
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    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
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  2. #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?

  3. #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?

  4. #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

  5. #20
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    MSO2007 on WinXP/MSO2000 on Win7/winXP
    Posts
    2,177

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

    You can use a UDF with a helper column:
    Option Explicit
    
    Public Function Reformat(ByVal DTUpdate As String) As Date
        Dim TimeFrag As String, _
            DateFrag As Variant
    
        'copy the time string
        TimeFrag = Mid(DTUpdate, InStr(DTUpdate, " ") + 1)
        
        'split the day, month and year into an array at the slash characters
        DateFrag = Split(Mid(DTUpdate, 1, InStr(DTUpdate, " ") - 1), "/")
        
        'rebuild the date from the pieces
        Reformat = CDate(DateFrag(1) & "/" & DateFrag(0) & "/" & DateFrag(2) & " " & TimeFrag)
    End Function
    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.2.0