Does anyone have any suggestions to do the following. I am trying to generate a unique reference number which repeats x number of times (in this example 3 times) before increasing.
BO-20-100-10001
BO-20-100-10001
BO-20-100-10001
BO-20-100-10002
BO-20-100-10002
BO-20-100-10002
BO-20-100-10003
BO-20-100-10003
BO-20-100-10003
and so forth.
I know how to create this list when each unique value is listed once. The trouble I am having is repeating the unique value x number of times and then increasing. Am I overlooking a very simple method for executing this type of series?
Regards
-Sam
Assuming that A2 holds BO-20-100-10001
Put this in A3 and copy down: =IF(COUNTIF(A$2:A2,A2)=3,LEFT(A2,10)&VALUE(RIGHT(A2,5))+1,A2)
Ken Puls, FCPA, FCMA, MS MVP
Learn to Master Your Data at the Power Query Academy (the world's most comprehensive online Power Query training), with my book Master Your Data for Excel and Power BI, or our new Power Query Recipe cards!
Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter
If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.
Bookmarks