简体   繁体   English

Excel中的条件Vlook up

[英]Conditional Vlook up in Excel

I have a table for seller name and sales我有一个卖家名称和销售额表

enter image description here在此处输入图像描述

I am matching data for : enter image description here我正在匹配数据:在此处输入图像描述

For Mark I an use simple vlook up formula but for Susan it is returning see other.对于 Mark I 来说,我使用了简单的 vlook up 公式,但对于 Susan 来说,它正在返回查看其他。 I want that it should look on other where Mark is assigned for Susan.我希望它应该查看为苏珊分配马克的其他位置。 It should go to again seller column and look for Mark and return 300 in Susan column instead of see other and return 140 for stephan.它应该再次转到卖家列并在 Susan 列中查找 Mark 并返回 300,而不是查看其他并为 stephan 返回 140。 How can I make formula which can return value for Mark as well as Susan correctly?如何制作可以正确返回 Mark 和 Susan 值的公式?

It's a bit of a confusing table setup, but the below formula should work.这有点令人困惑的表格设置,但下面的公式应该可以工作。 Just replace the {name_cell} with whatever cell is pointing to Mark or Susan.只需将 {name_cell} 替换为指向 Mark 或 Susan 的任何单元格。

=IF(INDEX(Table1[Sales],MATCH({name_cell},Table1[Seller],0))="see other",
INDEX(Table1[Sales],MATCH(INDEX(Table1[Other],MATCH({name_cell},Table1[Seller],0)),Table1[Seller],0)),
INDEX(Table1[Sales],MATCH({name_cell},Table1[Seller],0)))

Try this formula solution using Vlookup +If function.使用 Vlookup +If 函数尝试此公式解决方案。

In F2 , formula copied down :F2中,公式复制下来:

=IFERROR(VLOOKUP(VLOOKUP(E2,IF({1,0},$B$1:$B$7,$A$1:$A$7),2,0),$B$2:$C$7,2,0),VLOOKUP(E2,$B$2:$C$7,2,0))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM