Why can't VLOOKUP function right-to-left?

断了今生、忘了曾经 提交于 2019-12-08 02:48:12

问题


I know you can use INDEX/MATCH to do this, but is there a logical or specific reason why VLOOKUP cannot do this?

Maybe only Microsoft knows, but it seems simple enough that if it could have been done, it would have.

EDIT: to clarify, note the following formulas for the difference I am explaining.

=VLOOKUP(A1,A:C,3,false) - valid
=VLOOKUP(C1,C:A,3,false) - not valid


回答1:


Actually it is possible to do a right to left vlookup but you need to redifne your array. like this:

(A)      (B)    (C)
0,457   3,55    500
0,525   3,25    400
0,616   2,93    300
0,675   2,75    250
0,746   2,57    200
0,835   2,38    150
0,946   2,17    100
1,09    1,95    50
1,29    1,71    0

so here is a formula which fetches A1 when asked to lookup C1 in the array of A:A, C:C.

=VLOOKUP(C1;CHOOSE({2\1};A:A;C:C);2;FALSE)

Basically you need to redefine your lookup array, so I go for a 'choose' formula which sets up a table array where Column 1 is C:C and Column 2 is A:A. Then vLookup formula looks up the lookup_Value from C:C which is column 1 of the Table array and then locates 500 in C1 and then accordingly goes to A:A (column 2 of the table array) and pulls out the corresponding value from A1 which is 0,457.
P.S. depending on your country coding system, you need to replace all ";" with "," and "\" with ",".
You may download this file and open it in your excel and see how your excel translates these ";" "\" into your country coding system.



来源:https://stackoverflow.com/questions/27069409/why-cant-vlookup-function-right-to-left

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!