+ Reply to Thread
Results 1 to 7 of 7

Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

  1. #1
    Registered User
    Join Date
    09-06-2019
    Location
    College Station, Texas
    MS-Off Ver
    2019
    Posts
    2

    Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    I have one column in Excel 2019 containing a normal date (MM/DD/YYYY). I need to separate that date into three columns; one for MM, one for DD, and one for YYYY. I've tried to use the "/" as a separator in the text-to-columns, but that's not working for me. Any suggestions on how I might accomplish this? I'm using Win 10 and Excel 2019.
    Attached Files Attached Files
    BobF7845

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    You can do it with formulas that refer to the first column. Text to columns doesn't work because column A is not text.

    If you want to get rid of column A, you have two options.

    You can copy B:D and Paste Values then delete A
    You can copy A to B and Paste Values, then update the formulas for C and D to refer to B, then delete A.

    Formulas shown below.

    Values as displayed
    A
    B
    C
    D
    E
    1
    Date
    MM
    DD
    YYYY
    Description
    2
    10/21/2020
    10
    21
    2020
    Walmart
    3
    03/15/2021
    03
    15
    2021
    Di Iorio Farms
    4
    12/31/2020
    12
    31
    2020
    TRTA
    5
    10/30/2019
    10
    30
    2019
    DAV
    6
    08/13/2020
    08
    13
    2020
    Paralyzed Veterans
    7
    04/29/2021
    04
    29
    2021
    Boys Town
    8
    01/19/2018
    01
    19
    2018
    Wings 'n More
    Underlying formulas
    A
    B
    C
    D
    E
    1
    Date
    MM
    DD
    YYYY
    Description
    2
    44125
    =TEXT(A2,"MM")
    =TEXT(A2,"DD")
    =TEXT(A2,"YYYY")
    Walmart
    3
    44270
    =TEXT(A3,"MM")
    =TEXT(A3,"DD")
    =TEXT(A3,"YYYY")
    Di Iorio Farms
    4
    44196
    =TEXT(A4,"MM")
    =TEXT(A4,"DD")
    =TEXT(A4,"YYYY")
    TRTA
    5
    43768
    =TEXT(A5,"MM")
    =TEXT(A5,"DD")
    =TEXT(A5,"YYYY")
    DAV
    6
    44056
    =TEXT(A6,"MM")
    =TEXT(A6,"DD")
    =TEXT(A6,"YYYY")
    Paralyzed Veterans
    7
    44315
    =TEXT(A7,"MM")
    =TEXT(A7,"DD")
    =TEXT(A7,"YYYY")
    Boys Town
    8
    43119
    =TEXT(A8,"MM")
    =TEXT(A8,"DD")
    =TEXT(A8,"YYYY")
    Wings 'n More
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    Alternatively, MM=MONTH(A2), DD=DAY(A2) and YYYY=YEAR(A2).

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    Quote Originally Posted by josephteh View Post
    Alternatively, MM=MONTH(A2), DD=DAY(A2) and YYYY=YEAR(A2).
    You can do this and you would also have to update the formatting of the month and day cells to include leading 0's.

  5. #5
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,069

    Re: Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    Thanks Jeff.. OP has already format the cells as "00".

  6. #6
    Registered User
    Join Date
    09-06-2019
    Location
    College Station, Texas
    MS-Off Ver
    2019
    Posts
    2

    Re: Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    A BIG thank you to both josephteh and 6StringJazzer for their quick reply!

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Separate date (mm/dd/yyyy) into 3 separate columns (MM, DD, and YYYY).

    Late to the party again.

    Another way. In F2 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and format cells as you noted above.



    A
    B
    C
    D
    E
    F
    G
    H
    1
    Date
    MM
    DD
    YYYY
    Description
    MM
    DD
    YYYY
    2
    10/21/2020
    10
    21
    2020
    Walmart
    10
    21
    2020
    3
    03/15/2021
    03
    15
    2021
    Di Iorio Farms
    03
    15
    2021
    4
    12/31/2020
    12
    03
    2020
    TRTA
    12
    31
    2020
    5
    10/30/2019
    10
    30
    2019
    DAV
    10
    30
    2019
    6
    08/13/2020
    08
    13
    2020
    Paralyzed Veterans
    08
    13
    2020
    7
    04/29/2021
    04
    29
    2021
    Boys Town
    04
    29
    2021
    8
    01/19/2018
    01
    19
    2018
    Wings 'n More
    01
    19
    2018
    Dave

+ 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. Replies: 3
    Last Post: 04-25-2019, 11:05 AM
  2. Replies: 3
    Last Post: 07-14-2016, 06:36 PM
  3. Replies: 8
    Last Post: 10-02-2013, 06:23 PM
  4. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  5. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  6. Copy+Paste macro dd/mm/yyyy to dd/mm/yyyy and NOT dd/mm/yyyy to mm/dd/yyyy
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2012, 03:45 AM
  7. [SOLVED] opening excel file -> date format problem: DD/MM/YYYY vs MM/DD/YYYY
    By yung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 09:06 AM

Tags for this Thread

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