none
How to create a Calculated field in Document Library

    Question

  • So I have a document library based off of an excel file template. Each week a user will come in and create a document for the following Tuesday.  Once the document is created then it needs to be saved ts that week's staff Note's. The title should reflect "StaffNotes_week of_the date of the next Monday "

    Currently I can only get the formula to give me the current dates' date in this formula. Can someone help me alter it to give me either the first day of the week for the second a Monday or a Tuesday?

    ="StaffNotes. Week of: "&TEXT(Created,"mm-dd-yyyy")

    I figured out this formula to calculate the next monday but it will not accept in the formula box in sharepoint.  =DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())+7-WEEKDAY(TODAY(),3))


    Thursday, April 27, 2017 12:50 PM

Answers

  • Hi,

    Do you mean you want to get the next Monday date?

    If so, you could try this:

    ="StaffNotes. Week of: "&TEXT(Created-WEEKDAY(Created,3)+7,"mm-dd-yyyy")

    If this is not what you need, you’d better provide some sample cases so it would help others understand your requirements.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, April 28, 2017 7:24 AM

All replies

  • Hi,

    Do you mean you want to get the next Monday date?

    If so, you could try this:

    ="StaffNotes. Week of: "&TEXT(Created-WEEKDAY(Created,3)+7,"mm-dd-yyyy")

    If this is not what you need, you’d better provide some sample cases so it would help others understand your requirements.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, April 28, 2017 7:24 AM
  • StaffNotes_week of_the date of the next Monday means, if you create it today 28th April, then the file should be named as StaffNotes_week of_01052017 ?

    You need to know the date of next monday from the creation date? 

    -Sivanandham

    Friday, April 28, 2017 9:45 AM
  • Is there a way to add a validation to this to not allow two titles with the same date? To add a version number if a second one is added, but only to second or duplicate version?
    Monday, May 1, 2017 11:10 AM
  • Hi,

    This seems a little complex validation, validation would be difficult for this.

    You could try with PreSaveAction for this validation.

    Here is one thread for your reference.

    http://www.c-sharpcorner.com/article/pre-save-action-on-document-libraries-in-sharepoint-2013-and/

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, May 2, 2017 1:39 AM
  • Can you specify your complete requirement?

    Were you able to meet the naming part?

    The above question, if you enable versioning in SharePoint library it takes care of version number. but if the file with name already exists, the new data will become current version.

    Eg: You created file StaffNotes_week of_01052017.xlsx on 01.05.2017. Again you save another file with same name StaffNotes_week of_01052017.xlsx, the previous one will be version 1 and later will be version 2.

    I am not sure if this clarifies your doubt, because i am still not clear on your requirements.

    -Sivanandham

    Tuesday, May 2, 2017 1:13 PM
  • This is for a revolving needing. Each week users will need to create a new template for that week. Each week on that week's template there will be multiple users editing that template. This is to keep up with staff meeting notes. I need versioning in case someone creates the duplicate weekly file. So that the initial file has a separate name if any more files are created with the same week name. The naming policy is to allow the user to know which weeks file they are currently trying to add. 
    Wednesday, May 3, 2017 11:10 AM