+ Reply to Thread
Results 1 to 7 of 7

correcting a negative date formula

  1. #1
    Registered User
    Join Date
    08-24-2005
    Posts
    6

    correcting a negative date formula

    I have a sheet of data that has dates listed in reverse order as a number. I cannot get excel to read it as a date and put it in the correct date format. It currently reads like this: 20050921
    The first 4 numbers are the year and the next two are the month and then the day. I want it to read mm/dd/yyyy. Does anyone know how I can do this with a formula? I do no know how to create a macro but I can figure out most formulas. I just have not been able to come up with anything that will correct this for me.

  2. #2
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by woodlot4
    I have a sheet of data that has dates listed in reverse order as a number. I cannot get excel to read it as a date and put it in the correct date format. It currently reads like this: 20050921
    The first 4 numbers are the year and the next two are the month and then the day. I want it to read mm/dd/yyyy. Does anyone know how I can do this with a formula? I do no know how to create a macro but I can figure out most formulas. I just have not been able to come up with anything that will correct this for me.

    Try this ...

    =MID(A1,5,2)&"/"&RIGHT(A1,2)&"/"&LEFT(A1,4)


    Regards.
    BenjieLop
    Houston, TX

  3. #3
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    You can also try this ...

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


    Regards.

  4. #4
    Ron Rosenfeld
    Guest

    Re: correcting a negative date formula

    On Tue, 25 Oct 2005 08:29:32 -0500, woodlot4
    <[email protected]> wrote:

    >
    >I have a sheet of data that has dates listed in reverse order as a
    >number. I cannot get excel to read it as a date and put it in the
    >correct date format. It currently reads like this: 20050921
    >The first 4 numbers are the year and the next two are the month and
    >then the day. I want it to read mm/dd/yyyy. Does anyone know how I
    >can do this with a formula? I do no know how to create a macro but I
    >can figure out most formulas. I just have not been able to come up
    >with anything that will correct this for me.



    =DATE(INT(A1/10^4),MOD(INT(A1/100),100),MOD(A1,100))

    and format it as mm/dd/yyyy


    --ron

  5. #5
    Bob Phillips
    Guest

    Re: correcting a negative date formula

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

    or use Data>Text to Columns>Next>Next>Column Data Format>Date>YMD>Finish

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "woodlot4" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a sheet of data that has dates listed in reverse order as a
    > number. I cannot get excel to read it as a date and put it in the
    > correct date format. It currently reads like this: 20050921
    > The first 4 numbers are the year and the next two are the month and
    > then the day. I want it to read mm/dd/yyyy. Does anyone know how I
    > can do this with a formula? I do no know how to create a macro but I
    > can figure out most formulas. I just have not been able to come up
    > with anything that will correct this for me.
    >
    >
    > --
    > woodlot4
    > ------------------------------------------------------------------------
    > woodlot4's Profile:

    http://www.excelforum.com/member.php...o&userid=26613
    > View this thread: http://www.excelforum.com/showthread...hreadid=479097
    >




  6. #6
    Registered User
    Join Date
    08-24-2005
    Posts
    6
    This one worked for me:
    -or use Data>Text to Columns>Next>Next>Column Data Format>Date>YMD>Finish
    I seperated everything into different columns and then cut the year and pasted it in the order I wanted. Then I did a concatenate with a slash. it looks like a date but does not let me format it to read like one when I sort the info but I am many steps ahead of where I was. Thanks.

  7. #7
    Ragdyer
    Guest

    Re: correcting a negative date formula

    When you completed the TTC conversion that Bob suggested, your dates were
    *true* XL recognized dates.

    The changes you made to these true dates converted them back to Text again,
    and therefore not recognized by XL as numbers (dates).

    All you had to do was custom format that converted column to whatever
    display you wish.

    While the column is *still* selected from the TTC conversion, click on the
    menu bar:
    <Format> <Cells> <Number> tab,
    Click "Custom" in the left window,
    And enter this in the "Type" box:

    mm/dd/yyyy

    As you enter this, right above, you'll see your desired format displayed in
    the "Sample" window.
    --
    HTH,

    RD

    ---------------------------------------------------------------------------
    Please keep all correspondence within the NewsGroup, so all may benefit !
    ---------------------------------------------------------------------------
    "woodlot4" <[email protected]> wrote in
    message news:[email protected]...
    >
    > This one worked for me:
    > -or use Data>Text to Columns>Next>Next>Column Data
    > Format>Date>YMD>Finish
    > I seperated everything into different columns and then cut the year and
    > pasted it in the order I wanted. Then I did a concatenate with a slash.
    > it looks like a date but does not let me format it to read like one
    > when I sort the info but I am many steps ahead of where I was. Thanks.
    >
    >
    > --
    > woodlot4
    > ------------------------------------------------------------------------
    > woodlot4's Profile:

    http://www.excelforum.com/member.php...o&userid=26613
    > View this thread: http://www.excelforum.com/showthread...hreadid=479097
    >



+ 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