简体   繁体   English

如何从 excel 中的单个单元格计算逗号分隔的特定值

[英]How to count comma separated specific value from a single cell in excel

How to count comma separated specific values in a single cell in excel.如何计算 excel 中单个单元格中逗号分隔的特定值。 Suppose to found how many 15's are there in a single cell that contains 15,115,1515,15,215,15 I need the result 3. Is there any formula in excel假设在包含 15,115,1515,15,215,15 的单个单元格中有多少个 15,我需要结果 3。excel 中是否有任何公式

One way is to compare the length of the original value with the length of the value after you've replaced all the 15s with a zero-length string, and divide that by 4 (which is the length of ",15,").一种方法是将原始值的长度与将所有 15 替换为长度为零的字符串后的值的长度进行比较,然后将其除以 4(即“,15”的长度)。

One important note... make sure to add a comma to the start and end of the original string to pick up leading and trailing 15s.一个重要的注意事项......确保在原始字符串的开头和结尾添加一个逗号以获取前导和尾随 15 秒。

Here's what it would look like...这就是它的样子...... 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM