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!
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Watch MrExcel Video

Forum statistics

Threads
1,122,737
Messages
5,597,826
Members
414,180
Latest member
Sir Khaya

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
Top