Formula to get nearest numbers( 2% diff) from another set for a range

aravindhan_31

Well-known Member
Joined
Apr 11, 2006
Messages
672
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi,

Not sure if this will be confusing.

I have Salary data in sheet 1. Col A Emp Id and Col B Salaries
Id Salary
1 289750
2 290617
3 293696
4 293696
5 294941
6 30135
7 305000
8 305913
9 305913
10 307762
11 310464
12 317089

In sheet 2 I have Revised Salary
Amount
290000
298700
313635
329317
345783
363072
381225
400287
420301
441316
463382
486551

in Sheet 1 col C i want to bring these amounts for each employees, since I do not have data in sheet 2 at employee level I cant do a lookup. Instead what i need is
Check Salary of each employee against this range in Sheet 2, and see the diff if difference is between + or - 2%, then bring that amount to those employees. eg
for Emp Id 1 to 5, the salary I would enter Revised salary of 290000 and the reason is, the difference between old salary and revised salary is + or - 2% as shown below.

Old Salary Revised %
289750 290000 0.09%
290617 290000 -0.21%
293696 290000 -1.26%
293696 290000 -1.26%
294941 290000 -1.68%
301235 298700 -0.84%
305000 307661 0.87%
305913 307661 0.57%
305913 307661 0.57%
307762 307661 -0.03%
310464 307661 -0.90%
317089 316891 -0.06%

I have employee list of 600000 and 10000 rows of revised input amounts.

Either macro or formula will help. Thanks in advance
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Cross posted https://www.excelforum.com/excel-pr...bers-2-diff-from-another-set-for-a-range.html

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
Sure Fluff, I have given this link there, and i forgot to post here. apologies:)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
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