Find next available code

Rish12

New Member
Joined
Dec 29, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a set of codes and I want to find the next available code. Below is an example for it. So if I enter 02-002 then I should get the next code available which is 02-002-0004. I am looking for an excel formula instead of VBA code. Thanks for your assistance.


Product CodeInputAvailable Code
01-041-000102-00202-002-0004
02-001-0001
02-001-0002
02-002-0001
02-002-0002
02-002-0003
02-003-0001
02-003-0002
02-003-0003
02-003-0004
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Perhaps
Excel Formula:
=B2&"-"&TEXT(SUMPRODUCT(--(LEFT($A$2:$A$11,6)=$B2))+1,"0000")
 
Upvote 0
Solution

Forum statistics

Threads
1,223,885
Messages
6,175,180
Members
452,615
Latest member
bogeys2birdies

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