简体   繁体   中英

Returning value from range for any of the values that are looked up



I have the following data set:

在此处输入图片说明

and use the index/match function to check if the value in column A has a corresponding value in column b compared to values that are in another sheet called Data:

=IFERROR(INDEX(B:B,MATCH('Data A1'!,A:A,0)),"")

The goal of this exercise is to identify there is value in column B for any value in column A and here is where my formula fails, because for value 2 the formula returns an empty cell, because it is only checking for the first value in the list and not all values.

Any ideas on how I can fix the formula to reflect ABC when the value 2 is in the list? I am hoping for an outcome like this:


在此处输入图片说明

Thanks for your help!

It may be better to use a blank column to do this. In a blank column put the following formula in the first row:

=IF(B1="",SUMPRODUCT(($B$1:INDEX($B:$B,MATCH(1E+99,$A:$A))="")*($A$1:INDEX($A:$A,MATCH(1E+99,$A:$A))=A1)),B1)

Then Copy down the range.

在此处输入图片说明

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