Use Index Match to Return Value Using Lookup Value from Multiple Columns

陌路散爱 提交于 2020-01-17 06:23:20

问题


I'm trying to return a value from one column using values from a range of 3 columns. When I enter an electrical, plumbing or gas permit number into a report (D14) I want the corresponding building permit number to be entered into another cell as the file reference. The report is one worksheet and the list of permit numbers is another worksheet in the same workbook. It's one permit one report so I don't think I need anything complicated. VLOOKUP didn't work because I need to search right to left.

This is the Index Match formula I've used but I can only use 1 column as the lookup value and I have a column for each type of permit.

=INDEX(Building!$A2:$A25000,MATCH(D14,Building!$D2:$D25000,0))

回答1:


Wrap your MATCH function(s) in IFERROR function(s) so that the lookup is passed to the next column if it is not found.

=INDEX(Building!$A:$A, IFERROR(MATCH(D14, Building!$D:$D, 0),
                       IFERROR(MATCH(D14, Building!$E:$E, 0),
                       IFERROR(MATCH(D14, Building!$F:$F, 0), "nowhere"))))


来源:https://stackoverflow.com/questions/35281226/use-index-match-to-return-value-using-lookup-value-from-multiple-columns

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