View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Generate alphanumeric unique 4 digit values from 12 digit values

Mike,

If your 12 digit strings are in column A, starting in Row 2, then in cell B2 use the array formula
(entered with Ctrl-Shift-Enter)

=IF(COUNTIF($A$1:A2,A2)1,VLOOKUP(A2,$A$1:$B2,2,FA LSE),TEXT(MAX(VALUE($B$1:B1))+1,"0000"))

and copy down to match your list in column A. It will work, possibly slowly depending on how big
your list is...

HTH,
Bernie
MS Excel MVP


"mikep" wrote in message
...
I'm trying to convert 12 digit strings to individually unique 4 digit strings
for product coding. Any ideas?