From the looks of it your lists are quite long so I think you may need to check that statement carefully.
Firstly, the C2:C2 range in the formula must not contain blanks - see result in D2 below.
I'm assuming though that isn't a problem, but even with that corrected in E2 the result is incorrect.
Count 1
| B | C | D | E |
Accra; Londonderry; Austin, TX; Phoenix, AZ; Hong Kong | London | | | |
| Londonderry | | | |
| Accra | | | |
| Derry | | | |
| Phoenix | | | |
| | | | |
<colgroup><col style="font-weight:bold; width:30px; "><col style="width:387px;"><col style="width:107px;"><col style="width:56px;"><col style="width:49px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
</tbody>
Spreadsheet Formulas |
Cell | Formula | D2 | =SUMPRODUCT(--ISNUMBER(SEARCH($C$2:$C$20,B2))) | E2 | =SUMPRODUCT(--ISNUMBER(SEARCH($C$2:$C$6,B2))) |
<tbody>
</tbody> |
<tbody>
</tbody>
With your long list I think it highly likely you will have issues in there like the London/Londonderry issue above or names like York/New York, San Francisco/South San Francisco, Tu/Sturbridge etc
To overcome that, try either the standard-entry formula in D2 below or the array-entered formula in E2. That should be entered without the {} but confirmed with Ctrl+Shift+Enter, not just Enter. If confirmed correctly, Excel will insert the {}
Count 2
| B | C | D | E |
Accra; Londonderry; Austin, TX; Phoenix, AZ; Hong Kong | London | | | |
| Londonderry | | | |
| Accra | | | |
| Derry | | | |
| Phoenix | | | |
| | | | |
<colgroup><col style="font-weight:bold; width:30px; "><col style="width:374px;"><col style="width:167px;"><col style="width:36px;"><col style="width:30px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
</tbody>
Spreadsheet Formulas |
Cell | Formula | D2 | =SUMPRODUCT(--ISNUMBER(SEARCH("|"&C2:C6&"|","|"&SUBSTITUTE(SUBSTITUTE(B2,"; ","|"),",", "|")&"|"))) | E2 | {=COUNT(SEARCH("|"&C2:C6&"|","|"&SUBSTITUTE(SUBSTITUTE(B2,"; ","|"),",", "|")&"|"))} |
<tbody>
</tbody> |
Formula Array:
Produce enclosing { } by entering
formula with CTRL+SHIFT+ENTER! |
<tbody>
</tbody>