Sort a column for matching items and add an increment number in the adjacent column.

cguru

New Member
Joined
Jan 18, 2019
Messages
9
I am new to VBA and I'm not to sure how to do this. any help would really be appreciated.

Sort thru the "Same Issues" column and when you find Matching cells, mark in "Matching" column a number that is incremented by one for the next matching issue.

See the sheet below the results in Column D that I am expecting.
Function​
Same IssuesMatching
CatBrown in color
DogHe is bitting you
DogHe is licking you
MouseHe is eating chese
MouseHe is running away
ChickenLaying eggs1
ChickenLaying eggs1
LionRoaring
RabbitHe has green eyes
RabbitWhite Rabbit2
RabbitWhite Rabbit2
RabbitBlue Rabbit
RabbitHe is small3
RabbitHe is small3
RabbitRun fast run
RabbitRun slow
RabbitSuch a little one
RabbitHe is sitting4
RabbitHe is sitting4
RabbitHe is sitting4
RabbitHe jumps fast.5
RabbitHe jumps fast.5
RabbitHe jumps fast.5
RabbitHe jumps fast.5
RabbitHe jumps fast.5
RabbitHe jumps fast.5
RabbitHe jumps fast.5
RabbitHe is 123
RabbitFind him in bushes
TigerHe is big
TigerIn the water6
TigerIn the water6
WolfFat as a pig
DeerLong face
Deerwhere is he
DeerMust be a fawn
DeerFind his atllers7
DeerFind his atllers7
DeerFind his atllers7
DeerSmal deer
DeerLittle deer
Deerhungry deer8
Deerhungry deer8
DeerUnable to Upload9
DeerUnable to Upload9
DeerUnable to Upload9
DeerUnable to Upload9
DeerUnable to Upload9
DeerUnable to Upload9
MonkeyBig monkey10
MonkeyBig monkey10
MonkeyLittle Monkey
MonkeyFat Monkey
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You can do this with a formula.

Book1
ABCD
1FunctionSame IssuesMatchingFX
2CatBrown in color 
3DogHe is bitting you 
4DogHe is licking you 
5MouseHe is eating chese 
6MouseHe is running away 
7ChickenLaying eggs11
8ChickenLaying eggs11
9LionRoaring 
10RabbitHe has green eyes 
11RabbitWhite Rabbit22
12RabbitWhite Rabbit22
13RabbitBlue Rabbit 
14RabbitHe is small33
15RabbitHe is small33
16RabbitRun fast run 
17RabbitRun slow 
18RabbitSuch a little one 
19RabbitHe is sitting44
20RabbitHe is sitting44
21RabbitHe is sitting44
22RabbitHe jumps fast.55
23RabbitHe jumps fast.55
24RabbitHe jumps fast.55
25RabbitHe jumps fast.55
26RabbitHe jumps fast.55
27RabbitHe jumps fast.55
28RabbitHe jumps fast.55
29RabbitHe is 123 
30RabbitFind him in bushes 
31TigerHe is big 
32TigerIn the water66
33TigerIn the water66
34WolfFat as a pig 
35DeerLong face 
36Deerwhere is he 
37DeerMust be a fawn 
38DeerFind his atllers77
39DeerFind his atllers77
40DeerFind his atllers77
41DeerSmal deer 
42DeerLittle deer 
43Deerhungry deer88
44Deerhungry deer88
45DeerUnable to Upload99
46DeerUnable to Upload99
47DeerUnable to Upload99
48DeerUnable to Upload99
49DeerUnable to Upload99
50DeerUnable to Upload99
51MonkeyBig monkey1010
52MonkeyBig monkey1010
53MonkeyLittle Monkey 
54MonkeyFat Monkey 
Sheet1
Cell Formulas
RangeFormula
D2:D54D2=IF(COUNTIF($B$2:$B$54,B2)>1,IF(COUNTIF($B$2:B2,B2)=1,MAX($D$1:D1)+1,D1),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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