cjohnson309
New Member
- Joined
- Nov 27, 2017
- Messages
- 1
Hey All,
This is my first post on the website.
I'm looking to get a vlookup value based on the closest value. I have 3 different buckets with their different numbers. They do not exactly match the list on the left so i'm looking for a formula / VBA loop to automatically show the bucket name like so below next to the closest value.
I'm really looking for a VBA loop where it will first set Bucket #1 to the closest value, then when it is set, it will move on to Bucket #2 , etc.
Thanks!
Connor
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD]Bucket #1 [/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]Bucket #1 [/TD]
[TD][/TD]
[TD]Bucket #2 [/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD][/TD]
[TD][/TD]
[TD]Bucket #3[/TD]
[TD]46[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]Bucket #2 [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]35[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]40[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]45[/TD]
[TD]Bucket #3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
This is my first post on the website.
I'm looking to get a vlookup value based on the closest value. I have 3 different buckets with their different numbers. They do not exactly match the list on the left so i'm looking for a formula / VBA loop to automatically show the bucket name like so below next to the closest value.
I'm really looking for a VBA loop where it will first set Bucket #1 to the closest value, then when it is set, it will move on to Bucket #2 , etc.
Thanks!
Connor
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD]Bucket #1 [/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]Bucket #1 [/TD]
[TD][/TD]
[TD]Bucket #2 [/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD][/TD]
[TD][/TD]
[TD]Bucket #3[/TD]
[TD]46[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]Bucket #2 [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]35[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]40[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]45[/TD]
[TD]Bucket #3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]