+ Reply to Thread
Results 1 to 16 of 16

Number to date format

  1. #1
    Registered User
    Join Date
    10-02-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    14

    Number to date format

    Hi,
    In Cell A1 i have 50884 : its in text format. i need 8th may 1984 in cell b1 using formula.

    for time also: time is text format. eg: 0120 , i ned it has 1:20.

    pls tell me the formulas.

    Thank you.

  2. #2
    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,946

    Re: Number to date format

    That number represents 4/24/2039 not 8 may 1984 - that would be 41402

    Anyway, 1st, convert the text to a number = A1*1
    then format date as required
    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

  3. #3
    Registered User
    Join Date
    10-02-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Number to date format

    =datevalue(text(a1,"00-00-00"))

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

    Re: Number to date format

    Did you try my suggestion?

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Number to date format

    Quote Originally Posted by FDibbins View Post
    That number represents 4/24/2039 not 8 may 1984 - that would be 41402

    Anyway, 1st, convert the text to a number = A1*1
    then format date as required
    Would it be 30810 for 5/8/1984 ?
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Number to date format

    Maybe this?

    =TEXT(A1,"mm-dd-yyyy")&" "&TEXT(A1,"h:mm")

  7. #7
    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,946

    Re: Number to date format

    Yes you are correct, 30810 , I forgot to add/change the year. Thanks for the catch

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Number to date format

    50884 can be 8 may 84 or 5 aug 1984 now it will depend on your regional settings how it comes out
    in mine
    =DATEVALUE(TEXT(A1,"00\/00\/00")) comes out as 5 aug 1984
    so you may need
    =DATE(RIGHT(TEXT(A3,"000000"),2)+IF(RIGHT(A3,2)+0<50,2000,1900),LEFT(TEXT(A3,"000000"),2),MID(TEXT(A3,"000000"),3,2))
    to get 8 may 84 for dates between 1950-2050
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Number to date format

    Yea here it is:

    =IF(LEN(A1)=5,LEFT(A1,1)&"-"&MID(A1,2,2)&"-"&RIGHT(A1,2),LEFT(A1,2)&"-"&MID(A1,3,2)&"-"&RIGHT(A1,2))

    or this:

    =DATEVALUE(IF(LEN(A1)=5,LEFT(A1,1)&"-"&MID(A1,2,2)&"-"&RIGHT(A1,2),LEFT(A1,2)&"-"&MID(A1,3,2)&"-"&RIGHT(A1,2)))
    Last edited by AlKey; 10-07-2013 at 03:00 PM.

  10. #10
    Registered User
    Join Date
    10-02-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    14

    Thumbs up Re: Number to date format

    Quote Originally Posted by FDibbins View Post
    That number represents 4/24/2039 not 8 may 1984 - that would be 41402

    Anyway, 1st, convert the text to a number = A1*1
    then format date as required

    =a1*1 is ok but formating is not happening.
    i used one more function =datevalue(text(a1,"00-00-00")) it works.

    thank you.

  11. #11
    Registered User
    Join Date
    10-02-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Number to date format

    if i format its not showing the desired result.

    do u have something for time?

    thanks

  12. #12
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Number to date format

    What format do you need?

  13. #13
    Registered User
    Join Date
    10-02-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Number to date format

    0120 its in text format. i need it in time format. it should be HH:MM, ie., 1:20

    thank you.

  14. #14
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Number to date format

    I would assume that time in a different cell.

    =TIMEVALUE(TEXT(LEFT(A1,2)&":"&RIGHT(A1,2),"h:mm"))

  15. #15
    Registered User
    Join Date
    10-02-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2007
    Posts
    14

    Smile Re: Number to date format

    Quote Originally Posted by AlKey View Post
    I would assume that time in a different cell.

    =TIMEVALUE(TEXT(LEFT(A1,2)&":"&RIGHT(A1,2),"h:mm"))



    its working fine. Thank u

  16. #16
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Number to date format

    You're welcome. Don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ 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. Change backwards number format to date format
    By vickie10200 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2013, 01:32 PM
  2. Convert date and time in serial number format to text format
    By nda13112 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2013, 02:45 PM
  3. [SOLVED] How to convert date format into number format (VBA)
    By Gaz_m2k5 in forum Excel General
    Replies: 4
    Last Post: 03-29-2012, 10:39 AM
  4. Convert date from date format to number format
    By althea10 in forum Excel General
    Replies: 2
    Last Post: 02-17-2011, 10:54 AM
  5. * next to date format in Format>cells Number tab
    By Marco18+ in forum Excel General
    Replies: 6
    Last Post: 04-05-2006, 03:45 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