Identify blocks of the same value in a sequence with unique identifier

dgerding

New Member
Joined
Jul 11, 2012
Messages
2
Hi all -

I'm trying to randomly generate a unique identifier for each block of the same value in a column. In my mind, it's something that searches for "groups" or "blocks" of records in column A and then assigned a sequential identifier in column B. I'm not picky about the identifier, I just need each "block" to be unique.

Is this possible without writing a macro? I've attached an example below. I have over 40,000 rows so I really need to automate this process. Thanks in advance!

ValueUnique Sequence Identifier
YES1
YES1
YES1
NO2
NO2
NO2
NO2
NO2
NO2
NO2
NO2
NO2
YES3
YES3
YES3
YES3
YES3
YES3
YES3
NO4
NO4
NO4
NO4

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Welcome to the Board!

If you put a 1 in B2, then put this formula in B3 and copy it down you will get what you are asking for:

=IF(A3=A2,B2,B2+1)
 
Upvote 0

Forum statistics

Threads
1,214,835
Messages
6,121,880
Members
449,057
Latest member
Moo4247

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