Solved

SharePoint Calculated Field, Fixed Digits, Combined/Calculated Column

Posted on 2016-08-02
2
29 Views
Last Modified: 2016-08-04
I want to use the ID field to create an ID number consisting of prefix, and combining one field [year] with the default [ID] field.

I only have SharePoint 2010 design capabilities, so I'm not able to create workflow to auto-generate numbers or install additional software. Is there a way to restart the auto generated ID when there is a new year. For example, if I have two items, can I view them as below in the same list?

ITEM1-2005-0001
ITEM1-2006-0001
ITEM1-2007-0001

With a max of 5 years per list?

The issue that I'm having is that I want the generated new ID at the end to be only 4 digits and not 5 digits. Also, I want the numbering to restart if there is a different year.

Below is the formula that I'm using. When it gets to the number 10, it moves to 5 digits; how do I keep only 4 digits?

="PREFIX"&"-"&[YEAR]&"-"&"000"&[ID]

My Current Results --

PREFIX-2016-0002
PREFIX-2016-0003
PREFIX-2016-0004
PREFIX-2016-0005
PREFIX-2016-0006
PREFIX-2016-0007
PREFIX-2016-0008
PREFIX-2014-0009
PREFIX-2007-00010
PREFIX-2010-00011
PREFIX-2007-00012
PREFIX-2016-00013
PREFIX-2016-00014

These are the results that I would like to see
PREFIX-2007-0001
PREFIX-2007-0002
PREFIX-2010-0001
PREFIX-2014-0001
PREFIX-2016-0001
PREFIX-2016-0002
PREFIX-2016-0003
PREFIX-2016-0004
PREFIX-2016-0005
PREFIX-2016-0006
PREFIX-2016-0007
PREFIX-2016-0008
PREFIX-2016-0009
0
Comment
Question by:ckwillGWU
2 Comments
 
LVL 10

Accepted Solution

by:
Michael Vasilevsky earned 500 total points
ID: 41742254
Try:

=CONCATENATE("PREFIX-"&[YEAR]&"-",REPT("0",MAX(0,4-LEN(ID))),ID)
0
 

Author Closing Comment

by:ckwillGWU
ID: 41742972
Thank you Mvasilevsky! -- I believe that worked perfectly without having workflow rights.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question