Match Formula, Find next duplicate

D3allamerican07

Board Regular
Joined
Jul 22, 2015
Messages
101
I have two groups of data I am trying working with. In each group, there is a column with a unique value. I am trying to match those values together and then sort so I get a 1-to-1 match on rows.

Unfortunately, there are duplicates, so when applying the formula, =IF(COUNTIF(H:H,Q2)>1,"Duplicate",MATCH(Q2,H:H,)), I cannot sort properly.

Q2 = Lookup Value
H:H = Range

Is there a way I can either before, during, or after applying the formula:
  1. Find the matching row number
  2. If there is a duplicate, find the first matching row number
  3. then the second matching row number
  4. then the third,
  5. etc.

Thank you in advance!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi Bill,
what you could do is a formula like:
=COUNTIF(H$1:H2,Q2) and drag that down (notice the $). You'll basically get a number for every row, showing how many times that value has occured in that row or above. That should help you getting to the n-th value.
Cheers,
Koen
 
Upvote 0

Forum statistics

Threads
1,215,001
Messages
6,122,648
Members
449,092
Latest member
peppernaut

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