VLOOKUP可以将数组作为标准吗?

时间:2017-08-18 19:19:51

标签: excel formula

而不是:

=IFERROR(VLOOKUP("Red",$AA$5:$AB$54,2,FALSE),0) + IFERROR(VLOOKUP("Green",$AA$5:$AB$54,2,FALSE),0) + IFERROR(VLOOKUP("Blue",$AA$5:$AB$54,2,FALSE),0)

我能写这样的东西吗?

=IFERROR(VLOOKUP(Array("Red","Green","Blue"),$AA$5:$AB$54,2,FALSE),0)

我试过了:

=IFERROR(VLOOKUP(AND("Red","Green","Blue"),$AA$5:$AB$54,2,FALSE),0)

但是返回#VALUE(当没有IFERROR时)

或者,如果我有一个包含20多个值的列表,我可以将它们写入可以用作标准的命名范围吗?

1 个答案:

答案 0 :(得分:1)

使用此:

=SUMPRODUCT(SUMIF(AA:AA,{"Red","Green","Blue"},AB:AB))

您还可以用一系列单元格替换{"Red","Green","Blue"}

enter image description here