Hi All,
Spliced together a formula that creates a unique, 17-digit serial number that includes a four-digit julian date and checks to see if the last number used is the same date: 1) If so, generate the next serial number (0002 if the line before was 0001) or 2) If the dates aren't the same, use 0001.
IF(ISBLANK(B3),"","N39040"&RIGHT(TEXT(TODAY(),"y"))&TEXT((TODAY()-DATEVALUE("1/1/"&TEXT(TODAY(),"y"))+1),"000")&IF(MID(A2,7,4)=RIGHT(TEXT(TODAY(),"yyyy"))&TEXT((TODAY()-DATEVALUE("1/1/"&TEXT(TODAY(),"y"))+1),"000"),"X"&TEXT((MID(A2,12,3)+1),"000"),"X001")&"XXX")
Using today's date and my first line for today it would produce: N390403296X001XXX
N39040 = Static text for all lines.
3296 = 3 (Last digit of this year) and 296 (Julian Date)
X = Static Text for all lines.
001 = First line of the day.
XXX = Static text for all lines.
Formula works as designed; however, when I open the file tomorrow, the julian date will change to 3297. When I open the file on a "new" day, how can I keep the julian dates on the "old" lines from changing? How do I keep the unique serial number once it's assigned?
Paul
Bookmarks