encraste
encraste

Reputation: 3

Excel - Incrementation at each change in another column

I want to increment numbers in the B column at each change in the A column.

Example:(below attached image)

Incrementation at each change in another column

Any help please? Thanks in advance.

Best Regards, Bob.

Upvotes: 0

Views: 66

Answers (2)

Péter Mag
Péter Mag

Reputation: 41

Write 1 for the B1 cell. From the B2 cell, insert the form below.

=IF(A2=A1;B1;B1+1)

Upvotes: 2

JvdV
JvdV

Reputation: 75840

Like so:

=IF(A2<>A1,B1+1,B1)

enter image description here

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)

enter image description here

Upvotes: 1

Related Questions