Auto Increment Number Starting with Year

I have a task list, and i would like to create an auto increment column when a new task is created. I also would like this number start and repeat every year. For example: 2017-001. 2017-002.... 2018-001, 2018.002.

I am very new in SharePoint calculated column and Designer.

Thanks in advance
SON NGUYENAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Keyboard CowboyCommented:
I  use a workflow on the task list and an separate list to keep track of the numbering.  
You set up a separate list (called say IDTracker) -with the fields Title, NextID (number), and EndDate (date).
Create a  record with the values "TaskID",  NextID= 1, and  EndDate =  12/31/2018. (enddate is the last day to use this tracker value - it cycles below back to one after this date
I called the workflow variables all starting with var_ (to be clear here).
var_date of type 'Date',  var_n of type 'number' , the rest are strings

Then in a workflow on the task list -you do the following
First you need to see if the year has cycled - so .
set var_date = lookup value of column enddate on idtracker with title="TaskID"
If var_date < created date then
    then you need to update the ID tracker item
    add one year to var_date - place back into var_date  (use ADD time to a date action)
    update idtracker (title="TaskID") - with the new values nextid = 1 and enddate=var_date
endif
ok - now grab the next id (it may have been set to 1 above)
set var_n = Lookup column NextID in list IDtracker where title=taskid - (this is a number field!)
ok - let's format it - say something like yyyy-nnnn - like 2018-0010
Use extract to grab the "yyyy" from the created date and set to field var_yyyy (type string)
you can do this using extract from index of a string  from the created field value
set var_n_string to "0000" plus var_n  (this would give you something like 000010)
extract the last 4 chars from var_n_string - and place back into var_n_string - using extract from end of string.
This would give you something like 0010 for the end of your task id
set Task ID field in your task list to [var_yyyy]-[var_n_string}  -   using "set Field in current item to  (click on the ...) )
ok - now update the idtracker value for the next time this runs on another record.
add one to var_n - place back into var_n - using the Do Calculation action
update item in IDtracker  - set field NextID to var_n where title = "TaskID"

If you need to I can screen shot an example and send you snaps if you're new to workflows.  
you're done. - you can also cycle on Fiscal Years instead of calendar years if you want - whatever you set enddate to in the IDtracker list.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Keyboard CowboyCommented:
Let me know if you need additional help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.