VBA match column values and tag matches [within tolerance]

LeoRexmundi

New Member
Joined
May 29, 2018
Messages
1
Hi!

So here's a broad description of what I want to do:

Given values in column B [1, 6, 3, 18... -5, -6, -22...] I want to write a script that gives a unique tag in column C next to each pair where a positive and negative value will cancel out. EXAMPLE:

B | C
3 | 1
7 |
4 |
1 | 2
-3 | 1
-1 | 2

I know generally how I would get my values into an array and sort and tag them (using a 2xN array where N is the number of values in column B and the second column stores the unique ID) but I'm stuck on getting that tag to display in the correct rows.

Any help would be greatly appreciated :) [bonus points if you can figure out a way to reference a designated cell that stores a plus/minus tolerance amount and separately tags matches within that tolerance]

Thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,213,522
Messages
6,114,112
Members
448,549
Latest member
brianhfield

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