简体   繁体   English

计算单元格中的值数

[英]Count number of values within cell

I am trying to count the number of values within a cell, in Excel. 我正在尝试计算Excel中单元格中的值数量。 So far I have found plenty of ways to count the number of characters, regardless of whether they're a space, number, or letter. 到目前为止,我已经找到了很多方法来计算字符数,而不管它们是空格,数字还是字母。 However, I would like to count the number of values in a list or a cell, like so: 但是,我想计算列表或单元格中值的数量,如下所示:

Let's say in cell A1 I have the following sequence of values: 假设在单元格A1中,我具有以下值序列:

38 39 101 102 114 115 116 117 118 119 120 121 122 123 124 125

I would like for the cell to return 16 , indicating that there are sixteen values in the cell. 我希望该单元格返回16 ,指示该单元格中有16个值。

Is there an easy way to do this with Excel? 有没有简单的方法可以用Excel做到这一点?

If you have a known delimiter (what breaks up the values) and you don't have to test your data for whether it's a value or non-value then... 如果您有一个已知的定界符(将值分解),则不必测试数据是值还是非值,那么...

=LEN(A1)-LEN(SUBSTITUTE(A1,"[Your delimiter here]",""))+1

https://support.microsoft.com/en-us/kb/187667 https://support.microsoft.com/zh-CN/kb/187667

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

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