Simple vlookup gremlin

Jordo82

New Member
Joined
Aug 31, 2004
Messages
47
Hi All,

I've got a table with percentages running down the left side that I want to do a vlookup on. The percentages are in increments of 1, beginning at 4.1%. So I have 4.1, 5.1, 6.1 etc.

I'm using the round function to get integer results and then adding on the extra .1% to do the lookup. So my formula looks like VLOOKUP(ROUND(A1,2)+0.001,R1:T40,2,false) where A1 contains a random percentage value.

This works fine except for the value of 14.1%, which produces a N/A error on the vlookup function. I've tried re-entering 14.1% into the table. I've verified that my round function results in 14.1% by checking ROUND(A1,2)+0.001 = .141 and the result is true. The formula auditor shows nothing wrong until vlookup executes. I'm at a total loss, any help is appreciated! Thanks.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Follow up: it's not even the round function.

VLOOKUP(.141.... works but
VLOOKUP(.14+.001... doesn't.

Again, this is only for 14.1%. It works fine for 15.1, 16.1, etc. ARG!
 
Upvote 0
You could also try:

Code:
=VLOOKUP(ROUNDUP(A1+0.001,2),R1:T40,2,TRUE)

Using "TRUE" as the final term will cause Excel to find the closest match, without going over your first term. If A = 14%, adding the .001 to it will cause it to be rounded up to 15%. The closest match without exceeding 15% would be 14.1%.
 
Upvote 0
Perfect Andrew, thanks so much!

Must have been a tiny decimal being added in error... **** floating points.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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