Next Number

Pestomania

Active Member
Joined
May 30, 2018
Messages
332
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have the following data (to start with) and am trying to create a "unique sku" for each category

CategoryCategory 2Sku Start
Key ChainState ShapedKC0000
CoasterState PuzzleC00000

I would like to take the first letter of each word in the "Category" column and that is the first identifier in SKU Start.

And then I am hoping to get it to look for any SKU that already exists (in this case KC0000) and pick the next one which would be KC0001.

The SKU should always be 6 digits.

So a possible table would be:

CategoryCategory 2Sku Start
Key ChainState ShapedKC0000
CoasterState PuzzleC00000
Key ChainFunnyKC0001
Key ChainTarotKC0002

Thank you!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
See if this is what you want.

24 11 09.xlsm
AC
1CategorySku Start
2Key ChainKC0000
3CoasterC00000
4Key ChainKC0001
5Key ChainKC0002
6Key ChainKC0003
7StickS00000
8CoasterC00001
9StickS00001
10StickS00002
11Key ChainKC0004
SKU
Cell Formulas
RangeFormula
C2:C11C2=LET(r,C$1:C1,pref,CONCAT(LEFT(TEXTSPLIT(A2," "),1)),x,LEN(pref),prev,FILTER(r,(LEFT(r,x)=pref)*ISNUMBER(-MID(r,x+1,1))*(r<>C$1),pref&"-1"),pref&TEXT(MID(TAKE(prev,-1),x+1,5)+1,REPT(0,6-x)))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top