如何计算每行单个单元格中的条目数?大家好,
下面是我正在使用的示例。 “Column-to-Count”在该列的每个单元格中都有多个条目。我想输出每个单元格的计数,即“计数”列。
|列计数|计数|
| ab1、tgh9o、pl79s | 3 |
| ab1,fisc8u | 2 |
| ab1、psivb、7ushg8 | 3 |
是否有可用于生成“计数”列的公式类型?我查看了“计数”公式类型,这似乎不是我需要的。
谢谢你!
自动化和脚本编写内容组织视窗回复:如何计算每行单个单元格中的条目数?这是公式
Length( Words( :"Column-to-Count"n, "," ) )
回复:如何计算每行单个单元格中的条目数?太棒了 - 这很好用 - 谢谢!
@txnelson后续问题,如果有多个“ab”项而我只想计算这些项怎么办?
| 列计数 | ab计数|
| ab1、ab2、ab3、tgh9o、pl79s | 3 |
| ab1,fisc8u | 1 |
| ab1、psivb、7ushg8 | 1 |
我尝试将上面的公式与 Length( Words( :"Column-to-Count"n, "ab" ) ) 一起使用,但它没有给我正确的计数。
回复:如何计算每行单个单元格中的条目数?其他方式
New Table( "Sample table",
Add Rows( 3 ),
New Column( "Column-to-count",
Character,
Nominal,
Set Values( {"ab1, tgh9o, pl79s", "ab1, fisc8u", "ab1, psivb, 7ushg8"})
),
New Column("Count",
Numeric,
Continuous,
Formula(N Items( Words( :"Column-to-count"n, ", " ) ))
)
)回复:如何计算每行单个单元格中的条目数?要仅计算具有“ab”的元素,这里有一个强力公式
alist = Words( :Column 1, ", " );
acount = 0;
For( i = 1, i <= N Items( alist ), i++,
If( Contains( alist[i], "ab" ),
acount
++)
);
acount;