lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I have table like below, so I wrote vlookup function. user will enter id # and vlookup will return the salary. the vlookup function works no problem. then I tried to enter id = 100 which is not existed in the table, vlookup returned to me the last salary 17K. I tried different ID not existed in the range and vlookup keeps returning the last salary! why is that? I expected #value message or something like that. Thank you so much.
[TABLE="width: 320"]
<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]id[/TD]
[TD="width: 64"]first[/TD]
[TD="width: 64"]last[/TD]
[TD="width: 64"]dept[/TD]
[TD="width: 64"]salary[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]john1[/TD]
[TD]clark1[/TD]
[TD]it[/TD]
[TD]43 k[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]mary1[/TD]
[TD]jones1[/TD]
[TD]hr[/TD]
[TD]38 k[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]alex1[/TD]
[TD]wilson1[/TD]
[TD]sales[/TD]
[TD]55 k[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]sarah1[/TD]
[TD]king1[/TD]
[TD]marketing[/TD]
[TD]97 k[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]david1[/TD]
[TD]lkim1[/TD]
[TD]it[/TD]
[TD]37 k[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]john2[/TD]
[TD]clark2[/TD]
[TD]it[/TD]
[TD]17 k[/TD]
[/TR]
</tbody>[/TABLE]
I have table like below, so I wrote vlookup function. user will enter id # and vlookup will return the salary. the vlookup function works no problem. then I tried to enter id = 100 which is not existed in the table, vlookup returned to me the last salary 17K. I tried different ID not existed in the range and vlookup keeps returning the last salary! why is that? I expected #value message or something like that. Thank you so much.
[TABLE="width: 320"]
<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]id[/TD]
[TD="width: 64"]first[/TD]
[TD="width: 64"]last[/TD]
[TD="width: 64"]dept[/TD]
[TD="width: 64"]salary[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]john1[/TD]
[TD]clark1[/TD]
[TD]it[/TD]
[TD]43 k[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]mary1[/TD]
[TD]jones1[/TD]
[TD]hr[/TD]
[TD]38 k[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]alex1[/TD]
[TD]wilson1[/TD]
[TD]sales[/TD]
[TD]55 k[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]sarah1[/TD]
[TD]king1[/TD]
[TD]marketing[/TD]
[TD]97 k[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]david1[/TD]
[TD]lkim1[/TD]
[TD]it[/TD]
[TD]37 k[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]john2[/TD]
[TD]clark2[/TD]
[TD]it[/TD]
[TD]17 k[/TD]
[/TR]
</tbody>[/TABLE]