Reputation: 3
I want to increment numbers in the B column at each change in the A column.
Example:(below attached image)
Any help please? Thanks in advance.
Best Regards, Bob.
Upvotes: 0
Views: 66
Reputation: 41
Write 1 for the B1 cell. From the B2 cell, insert the form below.
=IF(A2=A1;B1;B1+1)
Upvotes: 2
Reputation: 75840
Like so:
=IF(A2<>A1,B1+1,B1)
Just drag down the formula in B2...
Or in case you don't have headers but your data starts in A1:
IF(ROW(A1)>1,IF(A1<>INDIRECT("A"&ROW(A1)-1),INDIRECT("B"&ROW(A1)-1)+1,INDIRECT("B"&ROW(A1)-1)),1)
Upvotes: 1