+ Reply to Thread
Results 1 to 4 of 4

How to convert a number "eg: 19521016" to date format

  1. #1
    Guru
    Guest

    How to convert a number "eg: 19521016" to date format

    I have a date that is noted in this format : 19521016 where 1952 is year, 10
    is month, and 16 is date.

    Now how to convert this to dd/mm/yyyy format.

  2. #2
    Stuart
    Guest

    RE: How to convert a number "eg: 19521016" to date format

    In a sheet, you could use a formula like the following to convert the number
    to a date and format it any way you'd like:

    =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,2,2))

    where the date is in cell a1. In VBA, you could do the same thing using the
    Left, Mid and DateSerial functions.

    Stuart

    "Guru" wrote:

    > I have a date that is noted in this format : 19521016 where 1952 is year, 10
    > is month, and 16 is date.
    >
    > Now how to convert this to dd/mm/yyyy format.


  3. #3
    Marvin
    Guest

    RE: How to convert a number "eg: 19521016" to date format

    At the simplest level,assuming your date is in cell B10 then

    19521016
    c10 =LEFT(B10,4)
    d10 =MID(B10,5,2)
    e10 =RIGHT(B10,2)
    f10 =DATE(C10,D10,E10)
    and apply custom format "dd/mm/yyy"

    "Guru" wrote:

    > I have a date that is noted in this format : 19521016 where 1952 is year, 10
    > is month, and 16 is date.
    >
    > Now how to convert this to dd/mm/yyyy format.


  4. #4
    JE McGimpsey
    Guest

    Re: How to convert a number "eg: 19521016" to date format

    Simpler:

    Select the cell. Choose Data/Text to Columns. Click Next, Next. Choose
    YMD from the Date dropdown. Click Finish.

    In article <[email protected]>,
    Marvin <[email protected]> wrote:

    > At the simplest level,assuming your date is in cell B10 then
    >
    > 19521016
    > c10 =LEFT(B10,4)
    > d10 =MID(B10,5,2)
    > e10 =RIGHT(B10,2)
    > f10 =DATE(C10,D10,E10)
    > and apply custom format "dd/mm/yyy"
    >


+ 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