Incremental numbers

GordonLS

Board Regular
Joined
May 28, 2021
Messages
89
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I need to incrementally increase the number in column A for every unique record in column B. In other words, Cell A1 has the number 1, Cell B1 has the name John. John is in the 1st 10 rows of column B and all Johns receive the number 1 in column A. Cell B11 has the name Cindy, and this needs the number 2 in column A and so forth.

Thank you
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
How about
Excel Formula:
=SUMPRODUCT(1/(COUNTIFS(B$2:B2,B$2:B2)))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Is there another method. Not sure why but this is extremely slow. I have 20,000 records and it just crawls. Cant get it to complete.
 
Upvote 0
How about
+Fluff 1.xlsm
AB
1countCounty
21County Durham
31County Durham
41County Durham
52Derbyshire
62Derbyshire
73Devon
84Dorset
95Gloucestershire
105Gloucestershire
116Greater Manchester
127Hertfordshire
138Lancashire
148Lancashire
158Lancashire
169North Yorkshire
179North Yorkshire
189North Yorkshire
1910Somerset
2011South Yorkshire
2111South Yorkshire
2211South Yorkshire
2311South Yorkshire
2412Staffordshire
2512Staffordshire
2612Staffordshire
2713Surrey
2813Surrey
2914West Midlands
3014West Midlands
Lists
Cell Formulas
RangeFormula
A2:A30A2=IF(B2=B1,A1,MAX(A$1:A1)+1)
 
Upvote 0
I will give that a shot. Not sure if it's just my computer. The file has 50,000+ records
 
Upvote 0
With that amount of rows, a lot of formulae will be slow.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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