MS Excel: How to count the unique occurrences of a substring across two cells in the same row?
Edit
given your clarification that the relevant strings will always be in the format of xyz3##
, and that you do have Windows Office 365, we merely have to change fn
to reflect that:
Edit2
Formula changed to account for situation of no matches. In that case, the FILTER
function returns an error which COUNTA
would count
=LET(ss,FILTERXML(SUBSTITUTE(SUBSTITUTE("<t><s>" & SUBSTITUTE(A1&","&B1,",","</s><s>")&"</s></t>"," ",""),CHAR(160),""),"//s[not(preceding::*=.)]"),
fn,LEFT(ss,4)="xyz3",filter,FILTER(ss,fn),cnt,
COUNTA(filter),IF(OR(ISERROR(filter)),0,cnt))