![我想计算两个条件是否都为真,逻辑上按 AND 计算 excel](https://linux22.com/image/1608230/%E6%88%91%E6%83%B3%E8%AE%A1%E7%AE%97%E4%B8%A4%E4%B8%AA%E6%9D%A1%E4%BB%B6%E6%98%AF%E5%90%A6%E9%83%BD%E4%B8%BA%E7%9C%9F%EF%BC%8C%E9%80%BB%E8%BE%91%E4%B8%8A%E6%8C%89%20AND%20%E8%AE%A1%E7%AE%97%20excel.png)
我有两列,都是分类列。比如Age_group
和Engagement_category
。我想获取每个 Age_group 中每个 engagement_category 的计数。
| Engagement_category | Age_group |
|:-------------------:|:---------:|
| Nearly Engaged | 21-26 |
| Not Engaged | 31-36 |
| Disengaged | 36-41 |
| Nearly Engaged | 21-26 |
| Engaged | 21-26 |
| Engaged | 26-31 |
并输出为
| Age_group | Engaged | Nearly Engaged | Not Engagaged | Disengaged |
|:---------:|:-------:|----------------|---------------|------------|
| 21-26 | 1 | | | |
| 26-31 | | | | |
| 31-36 | | | | |
| 36-41 | | | | |
| 41-46 | | | | |
| 46-51 | | | | |
感谢您的时间和考虑。