I have data set like this :
City Money Code Quantity
London 1.96 54645641 3
London 1.96 54645641 3
London 1.96 54645641 3
Madrid 200 158484 4
Madrid 200 158484 4
Madrid 200 158484 4
Madrid 200 158484 4
Denver 56.7 494681818 1
and i would like to add a number to each line by repeated City's block, i mean to get this :
City Money Code Quantity Number
London 1.96 54645641 3 1
London 1.96 54645641 3 2
London 1.96 54645641 3 3
Madrid 200 158484 4 1
Madrid 200 158484 4 2
Madrid 200 158484 4 3
Madrid 200 158484 4 4
Denver 56.7 494681818 1 1
Some help would be appreciated
CodePudding user response:
Use COUNTIF with a variable range:
=COUNTIF($A$2:A2,A2)