vlookup with approximate values

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
The vlookup = =VLOOKUP(B2,$H$2:$I$5,2,1) with approximate values is working if the table like this

This table start H2:I5
averagegrade
0f
50c
60b
80a

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

nameaveragegrade
mary191a
mary240f
mary312f
mary476b

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>

but is I change the table above to

averagegrade
80a
60b
50c
0f

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

then I get wrong answers

nameaveragegrade
mary191f
mary240#N/A
mary312#N/A
mary476f

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>

Why is that? Thank you so much.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
To use an approximate match the table must be sorted lowest to highest
 
Upvote 0
Maybe something like this...


A
B
C
D
E
F
G
H
I
1
name​
average​
grade​
average​
grade​
2
mary1​
91​
a​
80​
a​
3
mary2​
40​
f​
60​
b​
4
mary3​
12​
f​
50​
c​
5
mary4​
76​
b​
0​
f​
6
mary5​
60​
b​

Formula in C2 copied down
=INDEX(I$2:I$5,IFERROR(MATCH(B2,H$2:H$5,-1)+1*ISNA(MATCH(B2,H$2:H$5,0)),1))

M.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
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