Home > Mobile >  How to generate unique trip id focusing some specific parameters?
How to generate unique trip id focusing some specific parameters?

Time:06-26

I need to operate around 15-20 trips per day using different sized trucks round the year. I need to generate Unique Trip ID in googlesheet based on date, month, year, truck size, transporter and the number of the trip on the day. The trip IDs will be unique in the column and input in Column U. The available trucks size are L-23, L-20, M-18, M-16,S-14,S12,T-10, T-8. Truck size is input in Column S. Transporters are MLS, TLT and AHK which is input in Column T. Suppose, a trip with truck size, S-12, will move on 25th June 2022,Saturday and the Transporter is MLS. So the unique trip id will be MLS1225062201 where MLS is the transporter,12 is the truck size, 25 is the date, 06 is the month, 22 is the year and 01 is the number of the trip on the mentioned day.

For more, here is the link of googlesheet enter image description here

Is it possible to generate using google apps script or any other formula?

CodePudding user response:

Use the formula:

=arrayformula(if(B2:B="","",(U2:U&query(split(T2:T,"-"),"SELECT Col2",0)&text(B2:B,"ddmmyy")&TO_TEXT(A2:A))))

Try adding a trip no. to for your team to fill up to help with the formula I provided

Since its an arrayformula, it will autogenerate based on the details you have normally filled in. I have done a version in the sheet you have shared.

https://docs.google.com/spreadsheets/d/1LeeWIHomcnk_sPahLNJ8pXeDEz1tjSGEoQGa3ulxiKU/edit#gid=1170569363

  • Related