Creating a unique ID

swati kanodia

New Member
Joined
Nov 16, 2015
Messages
5
Hi,

I am trying to create a unique ID for agents registered with me using multiple criteria. Please see the table below.

S. No.Agent IDNameCityStateState CodeCity Code
1Rahul KumarKanpurUttar PradeshUP0512
2Sushil RajKanpurUttar PradeshUP0512
3ArihantBareilyUttar PradeshUP0581
4SahilBareilyUttar PradeshUP0581

<tbody>
</tbody>


The State and city code are flowing from another sheet (using Index and Match) that i have not reproduced here.

So, i am trying to create a unique ID using the state and city code, like UP0512/01 for the first agent. i would want these to be created automatically since it is a large database. i was able to create the first part i.e. UP0512/ . how do i create the number part automatically?? i am stuck there.

Similarly, the ID for the next agent with the same city and state code should generate automatically like UP0512/02.

Any help would be greatly appreciated. Thanks a lot :)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Considering your State Code as Column F and City Code as column G. You can use the below formula.

=F2&G2&"/"&Row(A2)
 
Upvote 0
You'd need a sequential number, stored somewhere that always gets 1 added to it once the previous value is assigned. I can't think of how to do this without VBA though. A search brought up this thread.
 
Upvote 0
Thanks a lot for the reply, but i am afraid this would not solve my problem as i would want to start the id from 1 again for a different city. Thanks again
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,323
Members
449,218
Latest member
Excel Master

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