IF with multiple Vlookup each with multiple outputs

淺唱寂寞╮ 提交于 2020-03-25 16:04:38

问题


I have a question regarding the below excel formula,

the case is I want to lookup for a value in 'Workflow (2)' sheet if there're 3 conditions fulfilled

1- the value of C14 appears in O column in 'Workflow (2)' sheet (it may appear multiple times)

2- the value of E13 appears in I column in 'Workflow (2)' sheet (it may appear multiple times)

3- the value of D14 appears in D column in 'Workflow (2)' sheet (it may appear multiple times)

but there's just one match for the 3 values together, then view the last vlookup in the below code

    =IFERROR(IF(AND(VLOOKUP(C14,'Workflow (2)'!$O$2:$O$253,1,FALSE)=C14,VLOOKUP(E13,
'Workflow (2)'!$I$2:$J$253,1,FALSE)=E13,VLOOKUP(D14,'Workflow (2)'!$D$26:$D$253,1,FALSE)=D14),
VLOOKUP(D14,'Workflow (2)'!$D$2:$L$253,9,FALSE)),"")

the problem is that Vlookup always return the first match, this allows the formula to display a value but it's not correct, i need all vlookups to return all possible values then match the 3 conditions together to find the single common value that I'll vlookup it in the last vlookup formula

Example:

If i want to view red output in different sheet based on the values from previous columns in same row, using the above formula.

data sample

any ideas?

thanks.


回答1:


To search value with multiple criteria you can use following array formula:

=INDEX($D$2:$D$7,MATCH(1,($A$2:$A$7=G2)*($B$2:$B$7=H2)*($C$2:$C$7=I2),0))

Array formula after editing is confirmed by pressing ctrl + shift + enter



来源:https://stackoverflow.com/questions/60782705/if-with-multiple-vlookup-each-with-multiple-outputs

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