Skip to main content

Hi,


I have been trying to figure out how to increment a number upon adding a new line.


For example,


Line 1 = A0001

Line 2 = A0002

Line 3 = A0003


I understand that the function of auto-number helps but i would like the characters in the front and wanted to see if there was a more efficient way than manually inputting this every line.


Thank you.

Hi @Matthew_Chua,


welcome to Airtable community!


To do your process my recommendation is to apply the following steps:



  1. Create an autonumber field {autonumber}

  2. Create a formula field by where you have to calculate the length of the autonumber


LEN(CONCATENATE(autonumber,""))

The step 2 will convert the number value in to text so you can count the length by the Len() function. You need this because your serial number has 4 numerical digits

3. Create a formula that will generate the serial number based n the length of the autonumber. For better system efficiency I recommend to use SWITCH() formula:


SWITCH(number_length,1,"A000"&autonumber,2,"A00"&autonumber,3,"A0"&autonumber,4,"A"&autonumber)

Please try this and text us back if it worked 🙂


Thanks.

Dimitris Goudis


Hi @Matthew_Chua,


welcome to Airtable community!


To do your process my recommendation is to apply the following steps:



  1. Create an autonumber field {autonumber}

  2. Create a formula field by where you have to calculate the length of the autonumber


LEN(CONCATENATE(autonumber,""))

The step 2 will convert the number value in to text so you can count the length by the Len() function. You need this because your serial number has 4 numerical digits

3. Create a formula that will generate the serial number based n the length of the autonumber. For better system efficiency I recommend to use SWITCH() formula:


SWITCH(number_length,1,"A000"&autonumber,2,"A00"&autonumber,3,"A0"&autonumber,4,"A"&autonumber)

Please try this and text us back if it worked 🙂


Thanks.

Dimitris Goudis


Doesnt work, any more suggestions?


Reply