简体   繁体   中英

What is the formula for displaying a value if another value is in the same row in Excel?

I am trying to create a formula that populates the Location # value of the person that is in the same row and only if the person is in the Location Manager or the Assistant Location Manager columns. The screenshots show two different tabs of information. I am trying to populate the Location# cell in the first screenshot. Data will be pulled from the second screenshot. The formula should populate COL-04 for Jane Doe and COL-01 for John Doe. If they aren't in the two columns, then the cell should stay blank (" "). I hope I explained things clear enough. Thanks

公式位置

[ 数据]

IfError is not working properly.

应该是空白 公式

Assuming both the data starts from A1 and the LOCATION DATA sheet is named Sheet1, this should return the correct values:

=IFERROR(IFERROR(INDEX(Sheet1!A:A,MATCH(B1,Sheet1!C:C,0)),INDEX(Sheet1!A:A,MATCH(B1,Sheet1!D:D,0))),"")

Formula not tested, might be missing a bracket or comma:

=IF(B1=" ","",IFERROR(IFERROR(INDEX(Sheet1!A:A,MATCH(B1,Sheet1!C:C,0)),INDEX(Sheet1!A:A,MATCH(B1,Sheet1!D:D,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