简体   繁体   中英

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. 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. How can I make formula which can return value for Mark as well as Susan correctly?

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.

=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.

In F2 , formula copied down :

=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))

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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