Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- 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]
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]