+ Reply to Thread
Results 1 to 7 of 7

Extract Date (04/05/06) into Text (040506)

Hybrid View

  1. #1
    Who I Am
    Guest

    Extract Date (04/05/06) into Text (040506)

    I need a formula or a VBA code to extract a date into a string. Could
    you shed a light?

    Thanks in advance.


  2. #2
    Ron Coderre
    Guest

    RE: Extract Date (04/05/06) into Text (040506)

    Perhaps something like this:

    For a date in A1

    B1: =TEXT(A1,"mmddyy")

    You might also be able to just use a custom number format

    Select A1
    <format><cells><number tab>
    Category: Custom
    Type: mmddyy
    Click the [OK] button

    Is that something you can work with?
    ***********
    Regards,
    Ron

    XL2002, WinXP


    "Who I Am" wrote:

    > I need a formula or a VBA code to extract a date into a string. Could
    > you shed a light?
    >
    > Thanks in advance.
    >
    >


  3. #3
    AA2e72E
    Guest

    RE: Extract Date (04/05/06) into Text (040506)

    Or, try:

    replace(yourDateVaraibleOrvalue,"/","")




  4. #4
    ward376
    Guest

    Re: Extract Date (04/05/06) into Text (040506)

    =LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)


  5. #5
    ward376
    Guest

    Re: Extract Date (04/05/06) into Text (040506)

    =LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)


  6. #6
    ward376
    Guest

    Re: Extract Date (04/05/06) into Text (040506)


    oops, double post

    This formula will give you mmddyy as text as long as excel recognizes
    it as a date regardless of format. Even if it's formatted as a number,
    general etc.


  7. #7
    ward376
    Guest

    Re: Extract Date (04/05/06) into Text (040506)

    =LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)


+ 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