Multiple-column based lookups in Excel

一个人想着一个人 提交于 2019-12-01 12:38:59
Adriaan Stander

Have a look at using the DGET Excel function.

Set

  • A1 = ProdType
  • B1 = Type
  • C1 = Val

Then your provided data in A2:C5

Then

  • H1 = ProdType
  • I1 = Type
  • H2 = =PROD2 (Criteria 1)
  • I2 = =TYPE3 (Criteria 2)

And lastly, in H3:

=DGET(A1:C5,"Val",H1:I2)

That should get the value for you.

=SUMPRODUCT(($A$1:$A$4="PROD2")*($B$1:$B$4="TYPE3")*($C$1:$C$4))

This assumes that column C values are actually numbers and not text.

sancho.s

An improvement on the solution by Dick Kusleika for the case when the output column does not contain numbers is

=INDEX(C:C,SUMPRODUCT((A:A="PROD2")*(B:B="TYPE3")*ROW(C:C)),0)

Taken from here.

See also this answer.

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