locked
get year from data and add 1 RRS feed

  • Question

  • I want my final calculated column result to be  "2013-2014"  when the date being calculated from is like 2/14/2013.

    I was able to get the first year like this: =TEXT([Date of Event],"yyyy")  with a returned data type of "single line of text"

    I was able to get the second year like this :  =YEAR([Date of Event]+1) but it puts a comma in the returned value.  I tried to wrap text() around it but that didn't work.

    I tried: =TEXT([Date of Event],"yyyy")&"-"& TEXT(YEAR([Date of Event]+1))

    Thanks for any ideas.


    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Friday, April 11, 2014 10:24 PM

Answers

  • Hi run4it,

    I tested the following calculated formula (replace column "Created" with yours) in my SharePoint 2010 and it worked, you can try it in SharePoint 2007 see if it also could work.

    =YEAR(Created)&"-"&(YEAR(Created)+1)
    
    or
    
    =YEAR([Created])&"-"&(YEAR([Created])+1)
    
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Daniel Yang
    TechNet Community Support

    • Marked as answer by run4it Monday, April 14, 2014 3:26 PM
    Monday, April 14, 2014 9:44 AM
    Moderator

All replies

  • what about:

    =TEXT([date],"YYYY") & "-"& (TEXT([DATE],"yyyy")+1)


    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

    • Proposed as answer by Devendra VelegandlaMVP Friday, April 11, 2014 10:52 PM
    • Unproposed as answer by run4it Friday, April 11, 2014 10:57 PM
    Friday, April 11, 2014 10:48 PM
  • it throws an error.

    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Friday, April 11, 2014 10:58 PM
  • I have tested that and seems working fine, can you share the screenshot of your calculated column(formula).


    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

    Friday, April 11, 2014 11:04 PM
  • Hi run4it,

    I tested the following calculated formula (replace column "Created" with yours) in my SharePoint 2010 and it worked, you can try it in SharePoint 2007 see if it also could work.

    =YEAR(Created)&"-"&(YEAR(Created)+1)
    
    or
    
    =YEAR([Created])&"-"&(YEAR([Created])+1)
    
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Daniel Yang
    TechNet Community Support

    • Marked as answer by run4it Monday, April 14, 2014 3:26 PM
    Monday, April 14, 2014 9:44 AM
    Moderator
  • It worked!  thank you.


    There are no mistakes; every result tells you something of value about what you are trying to accomplish.

    Monday, April 14, 2014 3:26 PM