+ Reply to Thread
Results 1 to 10 of 10

How to split date and time from single cell to two cells

  1. #1
    Registered User
    Join Date
    09-23-2012
    Location
    asdf
    MS-Off Ver
    Excel 2007
    Posts
    5

    How to split date and time from single cell to two cells

    To all GURUJIS s

    Sir I need to change format of date and time that I get in a single cell - YYYYMMDD.HHMMSS in this format from my share broker say in cell "A" now I need to change this into the format DD/MM/YY in one cell and HH:MM:SS in another cell. I have very hard but not able to change the format, me being a zero in excel need help - sir kindly help me out

    Thanks to all

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need a macro

    Welcome to the Forum taprico. Please adhere to Forum Rule No. 1.

    1. Use concise, accurate thread titles. Your post title should describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    Also if you could attach a sample file with data, I'm sure you'll get a quicker response and more solutions to your request.

    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

  3. #3
    Registered User
    Join Date
    09-23-2012
    Location
    asdf
    MS-Off Ver
    Excel 2007
    Posts
    5

    How to split date and time from single cell to two cells

    Oh made a mistake - I tried to post it in the right place but seems it went wrong - Sir if you delete this thread then I can start a new one at the right place. Or if you transfer it to the appropriate place it would be a great help - Just guide me how to adhere to this rule 1 - this being my first post in 1 year I am a bit novice with this. Best will be to delete the post so that I can start anew again right as per the rule 1.

    Thanking you for your quick response.
    Last edited by taprico; 08-20-2013 at 09:31 AM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need a macro

    It's OK. To change the title of the thread, click EDIT on the original post, then click the Go Advanced button, then change the title. Please also attach a sample, so we can visualize your requirements.

  5. #5
    Registered User
    Join Date
    09-23-2012
    Location
    asdf
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to split date and time from single cell to two cells

    I get data from my share broker where in the date and time are in a single cell in the format YYYYMMDD.HHMMSS. I need to have it in two different cell one having date and the other having time - date in the format DD/MM/YYYY and time HH:MM:SS. I tried using the delimiting option but when the time is separated the zeros in front disappear and when I tried customizing with six digit numbers then the zero at the back disappears. Tried quite a few other tricks but failed with the time thing. Attaching a file with the data hope I manage to make everyone understand.


    Thanks to all
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-21-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: How to split date and time from single cell to two cells

    Hi Taprico,

    Try this
    Suppose your Date & time is in cell A1 = 10/08/2013 19:48

    In B1 type =Int(A1) and format the cell as Custom dd/mm/yyyy you will get 10/08/2013
    and
    In C1 type =Mod(A1,1) and format the cell as Custom hh:mm you will get time 19:48

  7. #7
    Registered User
    Join Date
    09-23-2012
    Location
    asdf
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to split date and time from single cell to two cells

    Dear Kmahesh

    I have already used this but when I use =Int(A1) I get a part of the data that is date in A1 in the active cell but when I change the cell format to date the data changes to a lots of hashes.
    And for =Mod(A1,1) it displays like a time but its quite different.

    Hope you understand what I mean.

    A1 = 20130820.093826 --------- in BI (=Int(A1)) = 20130820 = #######.... (when the B1 Cell is formated to date)
    A1 = 20130820.093826 --------- in C1 (=Mod(A1,1)) = 2:15:07

    Where am I going wrong

    Thanks

  8. #8
    Registered User
    Join Date
    07-17-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: How to split date and time from single cell to two cells

    Use this for code:
    A1 I used for teh source data.
    B1 Resulting Date
    C1 Resulting Time


    A1
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    B1
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    C1
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let me know if that helps you out at all.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: How to split date and time from single cell to two cells

    for the date...
    =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,8,2))
    for the time...
    =MOD(A1,1)*60
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    09-23-2012
    Location
    asdf
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to split date and time from single cell to two cells

    Thanks David and FDibbins to both of you. David's formula seems to be working. It does change the data as I want. Now I will have to check if the data goes into Amibroker or not.

    Will try that and report back

    Thanks to all

+ 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. [SOLVED] Split Date and Time Cell
    By Beamers in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-17-2013, 03:22 PM
  2. Split a single cell into 2 or more cells
    By Shaun010 in forum Excel General
    Replies: 11
    Last Post: 02-22-2013, 09:01 AM
  3. Excel Split Single Cell Array into Multiple Cells
    By devinpitcher in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 12-07-2012, 07:13 AM
  4. [SOLVED] Macro to split a single cell data into rows and copying other cells
    By CVARGA66 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2012, 04:29 PM
  5. Split the date & time in one cell to be 2 colums.
    By Aom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2006, 09:30 AM

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