简体   繁体   中英

Find Multiple Values Across Multiple Cells in Excel

I'm trying to figure out a way to search for multiple strings in Excel across multiple cells. I'm working with a database list of individuals and their corresponding address and demographic information. I need to find out a count and isolate the records of any cells with any of the names in the below formula in them. The formula works just fine when I'm only looking in one cell, ie B16 , but when I put in for example (B16:D16) it throws a #VALUE error.

=IF(OR(B16={"JOHN","CATHLEEN","JANES"}),1,0)

Any help you can offer is very much appreciated.

Thanks, Bill

    =IF(OR(B16:D16="John",B16:D16="Cathleen",B16:D16="Janes"),1,0)

This works as long as at least one of the names is in the range. If none of the names are in the range it will throw the #Value error. You could trap that out by wrapping this formula in an "IFERROR" function. I'm not sure how much use this formula is in that it only tells you that at least one of the names exists in the range, not which name or where in the list.

考虑:

=IF((SUMPRODUCT(--(B16:D16="JOHN"))+SUMPRODUCT(--(B16:D16="JANES"))+SUMPRODUCT(--(B16:D16="CATHLEEN")))=0,0,1)

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