+ Reply to Thread
Results 1 to 10 of 10

Converting date into a year

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Converting date into a year

    Dear Experts,
    Looks simple though but cant find a way to convert ‘Jan-12 to 2012 using any of the following
    ‘Jan-12 is in cell A1 and formulas are in cell B1 through B4
    Please Login or Register  to view this content.
    Attached, please find the excel sheet for quick reference.
    Best Regards/VKS
    Attached Files Attached Files
    Last edited by VKS; 01-14-2013 at 08:59 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Converting date into a year

    One way could be to use TEXT to Columns option to saparate JAN- IN A CELL AND THEN 12 in another.

    Then use =20& your cell with 12 in this
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Converting date into a year

    Hi VKS,

    Two more options are given in green cells, see attached file:-

    EF_Date_Help.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Converting date into a year

    hi VKS. i'm very curious of your problem. your 1st 3 solutions should work, despite the workarounds provided. the 4th solution will not because it's wrong. could you do:
    =DATEVALUE(A1)
    format it to a date & let me know what date does it refer to?

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Converting date into a year

    Thanks Fotis, Dilipandey & benishiryo
    @ benishiryo it gives 12-Jan-13

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Converting date into a year

    Nice one beni..

    Hi VKS, DATEVALUE is a good option but since you need to have 2012 as output, you need to subtract 1 from the year because DATEVALUE will give you 41286 which is 12-Jan-2013 and year is 2013 here

    I have observed, Excel uses current year always, when it finds that year part is missing in any date
    So basically if you enter two parts only out of DATEs requirement as 3 parts (Day Month Year), excel considers those two parts as "day" and "month" only and never assumes that you have entered "Year"

    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Converting date into a year

    Assuming that "12" in "Jan-12" is the year and not the day in Jan.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Similarly with your other formulae, except DATEVALUE(), use A1*1

    For DATEVALUE() use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Marcol; 01-14-2013 at 09:05 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Converting date into a year

    @ benishiryo it gives 12-Jan-13
    I have already explained about this in my previous post#6 and if you subtract 1 from the year, you are good to go

    Regards,
    DILIPandey
    <click on below * if this helps>

  9. #9
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Converting date into a year

    Thanks a lot Experts taking some time out on this.
    Best Regards/VKS

  10. #10
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Converting date into a year

    Cheers


    DATE & TIME calculations are most tricky part in any application software / language /databases


    Regards,
    DILIPandey
    <click on below * if this helps>

+ 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