Excel Formula to Find Matching Variations of a String - Excel 2016

Johnny Thunder

Well-known Member
Joined
Apr 9, 2010
Messages
693
Office Version
  1. 2016
Platform
  1. MacOS
Ok Gang, I have a project with a crazy time crunch and was hoping to have some help on the below.

I have a query of data that has a column with my Lookup Value (Variation 1) and a secondary column with an offsetting value that is backwards (Variation 2).

If you look at the data in column Variation1, these are my lookup values, I have only given 2 actual combinations but what I need the Unique key column to do is;

1, give each unique Variation a key so if you look at the first data set, 2000-8006 I have manually given it "key 1", then on the Variation 2 column the data is represented as an offset to Variation 1 but the string will be backwards.

So the formula will need to look row by row as well as looking above itself to ensure it has not already assigned a key# that has already been used.

I've highlighted below the variations that matched from my example, I just can't figure out how to write a statement or VB Code to get this done? Any help is appreciated.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Unique Key[/TD]
[TD]Variation 1[/TD]
[TD]Variation 2[/TD]
[/TR]
[TR]
[TD]Key 1[/TD]
[TD]2000-8006[/TD]
[TD]1000-5000[/TD]
[/TR]
[TR]
[TD]Key 2[/TD]
[TD]5000-3000[/TD]
[TD]8006-2000[/TD]
[/TR]
[TR]
[TD]Key 1[/TD]
[TD]1001-5000[/TD]
[TD]8006-2000[/TD]
[/TR]
[TR]
[TD]No Match Found[/TD]
[TD]1111-4444[/TD]
[TD]3231-5000[/TD]
[/TR]
[TR]
[TD]Key 2[/TD]
[TD]3000-1414[/TD]
[TD]3000-5000[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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