+ Reply to Thread
Results 1 to 7 of 7

Formula to use numbers from left and right of cell to create a date

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    Fairbury NE
    MS-Off Ver
    Excel 2007
    Posts
    70

    Formula to use numbers from left and right of cell to create a date

    Hi,
    I need to convert a number (i.e., 4-33624-13) to a date. In this case, "4" (first character on the left) is the month and "13" (two characters on the right) are the year. Ideally, it should read as a date, i.e., 04/13 or 04/2013. I've been trying to use the LEFT and RIGHT function, but can't seem to do it as one formula. Any ideas?
    Last edited by maryren; 09-19-2013 at 03:47 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula to use numbers from left and right of cell to create a date

    Edit- Irrelevant question was here before....


    Is the number of characters between the 2 -'s always the same?
    Last edited by Jonmo1; 09-19-2013 at 03:36 PM.

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Formula to use numbers from left and right of cell to create a date

    try this..

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    format cell to "mm/yyyy" if reuired..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Registered User
    Join Date
    06-12-2013
    Location
    Fairbury NE
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Formula to use numbers from left and right of cell to create a date

    yes, the length is always the same

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula to use numbers from left and right of cell to create a date

    If this is true...
    Quote Originally Posted by maryren View Post
    the length is always the same
    Try
    =REPLACE(A1,FIND("-",A1),7,"/1/")+0

    Format the formula cell as a date of your choice.

  6. #6
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Formula to use numbers from left and right of cell to create a date

    Fairbury, USA.. crossing finger.. still if date is not mm-dd-yyyy

    then try this also..

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  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,933

    Re: Formula to use numbers from left and right of cell to create a date

    or this?

    =DATE(20&RIGHT(A1,2)*1,LEFT(A1,SEARCH("-",A1,1)-1),1)
    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

+ 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. Create combobox if left cell has a value
    By excelit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2013, 11:15 AM
  2. [SOLVED] Move date shown in cell to new cell directly left once date has passed
    By jamieswift1977 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-16-2013, 11:23 AM
  3. Replies: 2
    Last Post: 01-27-2013, 12:20 AM
  4. [SOLVED] Create a formula to remove text to the left of specified char?
    By TheLazer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-18-2005, 07:06 AM
  5. Replies: 1
    Last Post: 02-15-2005, 12:06 AM

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