Solved

SharePoint Calculated Field, Fixed Digits, Combined/Calculated Column

Posted on 2016-08-02
2
24 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

For SharePoint sites, particularly public-facing ones, there are times when adding JavaScript, Meta Tags, CSS Styles or other content to the page <head> section is more practical than modifying master pages.  For instance, you could add the jQuery l…
Microsoft SharePoint Foundation 2010 and Microsoft SharePoint Server 2010 do not offer the option to configure the location of the SharePoint diagnostic trace log files during installation.  This can, however, be configured through Central Administr…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

773 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