简体   繁体   中英

Match in excel with multiple values in query cell

I have a column that has a list of genomes which are special. There is another column of genomes in which some cells have multiple entries, comma-separated. What I want is to check if for each cell of the second column, is any of its entries in the first column. If the cells in second column only had one element, I could do it with =NOT(ISERROR(MATCH(B2,$A$2:$A$120,0))) but since some query cells have muliple elements, this will not work for those. Any suggestions?

在此处输入图像描述

If you need to keep the rows in the genomes column, then Separate genomes column in 3 columns and do the MATCH in 3 new columns B,C & D.

=NOT(ISERROR(MATCH(A2,$B$2:$D$120,0)))

Try SUMPRODUCT and SEARCH :

=IF(SUMPRODUCT(--ISNUMBER(SEARCH(","&$A$2:$A$5&",",","&B2&","))),"Y","N")

在此处输入图像描述

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