I have tried using the formulas you previously posted to resolve my issue, but I am showing a 3 in column C for some of the Unique IDs instead of a 2. My goal is to assign a Unique ID whenever a record in column A is linked to a record in column B (1:1 or 1:may relationships).

C1 = 0
Then formula in C2
and then copy down the formula
or you can start with C2 = 1 Then formula in C3
Then copy down the formula