Match another two rows based on count of ID duplication/COUNT in another columns

Status
Not open for further replies.

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
157
Hi All can any one please help me on this.
i need first it has to check that how many times that id exists then based on id count it has to match name rows with similar nuber of times.
e.g. US127473334L id exits 3 times in columns A so then it sud go to column B and match 1st row company name with next two rows/ hope it makes sense.

ID Name
US127473334L ASPHUDSONELECTRICSALESCORP
US127473334L ASPHUDSONELECTRICSALESCORP
US131491494L ASPAGIINDUSAINTR
US131491494L ASPAGIINDUSAINTR
US133929949L ASPJONESLANGLASAC
US133929949L ASPJONESLANGLASAINC
US134399399L ASPCENTRALMONTANAMEDICALINC
US134399399L ASPCENTRALMONTANAMEDICAL

i made a macro but that is working on on compan names row by row.

'FOR Company
Range("F2").Select
ActiveCell.Interior.Color = vbYellow

For U = 2 To LASTROW1

Set MYNAME2 = Cells(U, "f")
Set MYNAME3 = Cells((U + 1), ("f"))

If MYNAME2.Value = MYNAME3 Then

SHGROUP.Cells(U, "f").Interior.Color = vbGreen
SHGROUP.Cells(U + 1, "f").Interior.Color = vbGreen
ActiveCell.Offset(1, 0).Select
Else:

ActiveCell.Offset(1, 0).Select
SHGROUP.Cells(U + 1, "f").Interior.Color = vbYellow

End If
Next U
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Status
Not open for further replies.

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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