简体   繁体   中英

Excel formula to count discrete instances of referenced cells

I have a column of strings, representing names, where there can be more than one name per cell and each is separated by a semicolon. There is a column next to it that has a single character which represents a category. To illustrate:

问题

My desired outcome is shown in the second box. What I need is a formula that, for each name in column B, counts up how many instances of the categories in column C were assigned to it.

I'm having difficulty reconciling the fact that there may be multiple names in each cell in column B. Can anyone think of an easy approach here?

Just use COUNTIFS and wildcards:

=COUNTIFS($B$2:$B$5,"*"&$G3&"*",$C$2:$C$5,H$2)

在此输入图像描述

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