Assign a unique number based on text in two other cells?

daithi_ie

New Member
Joined
May 26, 2022
Messages
9
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
I, apologies in advance if this has been answered before but I haven't been able to find a solution to my problem.

I'm trying to assign a unique number to a cell-based on data in two other cells. I have a competition coming up and we have loads of unique numbers to assign, over 500, and they have to go to a unique combination.

For example below, each unique forename (C1) and surname (D2) combination are assigned a unique number (B1).

Is there a formula I can use to do this? I have some knowledge of excel but am still learning loads from it! Hope you can help? TIA

TimeUnique NoForenameSurnameClubCompetition
09:001MaryAdamsEvergreenGrade 1
13:051MaryAdamsEvergreen Grade 2
09:102JohnAdamsBluegrassGrade 1
09:153JohnBrownCederwoodGrade 1
13:203JohnBrownCederwoodGrade 2
09:254BobbyCloverSeapointGrade 1
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi & welcome to MrExcel.
How about
Excel Formula:
=ROWS(UNIQUE(C$2:C2&"|"&D$2:D2))
 
Upvote 0
Solution
Hi, thanks for that but if I put your formula in B2 and drag it down it assigns 1 to all cells. I need them to have a unique number?
 
Upvote 0
It shouldn't do that, is calculation set to manual?
 
Upvote 0
Just tried it again and it worked a treat - you've saved me so much time. Really appreciated!!

Would this work in Google Sheets too?
 
Upvote 0
I've no idea, best way to find out is to try it.
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,822
Members
449,096
Latest member
Erald

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