Assign a number to each group of unique values in a column.

I have 43,504 rows of data.
Row 1 contains column headers.

I want Column A to have an "ID" number (starting with a value of "1" in A2 and ascending by "1") based on the value of Column B.

Start by comparing B2 to B3.
If B2 and B3 are the same, label A3 as "1".
If B2 and B3 are NOT the same, label A3 as "2" (=A2+1).
(then compare B3 to B4)
If B3 and B4 are the same, label A4 as "1" (=A3)
If B3 and B4 are NOT the same, label A4 as "2" (=A3+1)
(continue until a blank cell/row is reached.)

For example, the 2nd and 3rd rows of Column B contain "57827". I want these 2 rows of Column A to contain the value of "1".
The  4th row through 11th row of Column B contain "61034". I want these rows in Column A to contain "2".

ID-Value-Example.jpg
nicholasjwolfAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
zorvek (Kevin Jones)Connect With a Mentor ConsultantCommented:
Place in A2:

   1

Place in A3 and copy down:

   =IF(B2=B3,A2,A2+1)

Kevin
0
All Courses

From novice to tech pro — start learning today.