+ Reply to Thread
Results 1 to 6 of 6

Converting text and numbers to a calendar date

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Converting text and numbers to a calendar date

    Good afternoon everyone,

    I have a worksheet which uses both text and numbers to generate lot numbers for a product. However, I now need to also generate an expiry date 21 months and 30 months from the lot number date.

    The problem lies in the fact the lot numbers are generated by the following:

    Month: January (text format)
    Day: 01 (custom formate - dd)
    Year: 2012 (number formate - 0 decimal places) If I try to convert this cell to custom year format (yyyy) I get years in the 1900s - of course.

    Each of these are in their own cell. I need them to come together in a format that would allow me to calculate the expiry date and then of course display it in the standard mm/dd/yyyy for the end user.

    Can anyone give me a hand?

    Thanks!

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Converting text and numbers to a calendar date

    Hello,

    Assuming you have "January" on A1, you have 01 on B1, and 2012 on C1, you can try this formula
    =DATE(C1,MONTH("1"&A1),B1)
    Last edited by Lemice; 05-14-2013 at 04:34 PM. Reason: no idea why I put the wrong cell inside formula
    (copy pasta from Ford)
    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

    Regards,
    Lem

  3. #3
    Registered User
    Join Date
    04-23-2013
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Converting text and numbers to a calendar date

    Hello Lem,

    Can you please break this formula down for me? I am having difficulty with the column/row designation in your formula and how they relate to the column and row you have the elements assigned. If it is helpful, my data sits in the sheet as follows: "January" = B3, "01" = B4 and "2012" = B5

    Thank you

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Converting text and numbers to a calendar date

    In that case, try this one
    =DATE(B5,MONTH("1"&B3),B4)

    The syntax of DATE is DATE( year, month, Day ):
    - Year value is in B5, right?
    - Month value requires a little trick, MONTH("1"&B3) will return the number of the month, and the name of the month is in B3.
    - Day value is in B4

    Ugh, my eyes ...
    Last edited by Lemice; 05-14-2013 at 12:55 PM.

  5. #5
    Registered User
    Join Date
    04-23-2013
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Converting text and numbers to a calendar date

    Lem,

    Thank you! It worked like a charm. Much simpler than what I was attempting to do.

    Thanks again...my client will be very happy!


  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Converting text and numbers to a calendar date

    Glad that I could help.

    If you have found a fitting solution to your problem, please mark the Thread as [SOLVED] using the Thread tools right above post #1. It keeps things neat and tidy.

    Have a great day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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