Jul 13 2022 10:01 AM
I am working on a Document Registry and each Document will be assigned a 3 digit number starting at 001. I have formatted the cell so it shows as a 3 digit number but when I use the concat function to bring the whole identification number together, it shortens it to 1 digit (removing the 0's) but I need my document identification number to stay in the same format.
Ex.
This is what I need: 2022-01-QA-PUB-001-E
This is what I get: 2022-1-QA-PUB-1-E
I have tried using both the left and right functions =left(a1,2) or =right(a1, 3) and I still lose my 0's both ways. please help!
Jul 13 2022 10:20 AM
Is that exact format, i.e in 2022-1-QA-PUB-1-E numbers are always on second and fifth positions, or that could be different?
Jul 13 2022 10:24 AM
Jul 13 2022 11:06 AM
Solution
in H1:
=CONCAT(TEXT(DATE(A1,B1,1),"yyyy-mm"), "-", C1, "-", D1, "-", TEXT(E1,"000"), "-", F1)
if you run a recent version of Excel, in J1:
=TEXTJOIN("-",,TEXT(DATE(A1,B1,1),"yyyy-mm"), C1:D1, TEXT(E1,"000"), F1)
Jul 13 2022 11:27 AM
Jul 13 2022 02:32 PM