跳到主要内容

如何在Excel中的单个单元格中计算逗号分隔的值?

如果在单个单元格中用逗号分隔单元格内容,例如“ A1,A2,A3,A4,A5”,并且您要计算该单元格中逗号分隔值的总数,该怎么办? 在这种情况下,总的逗号分隔值应为5。在本文中,我们将向您展示两种在Excel中的单个单元格中计算逗号分隔值的方法。

用公式计算单个单元格中逗号分隔的值
使用出色的工具轻松在单个单元格中计算逗号分隔的值

有关在Excel中进行计数的更多教程


用公式计算单个单元格中逗号分隔的值

以下面的屏幕截图中的数据为例,请按照以下步骤计算范围B3:B7中每个单元格中的逗号分隔值。

1.选择一个空白单元格以输出结果。

2.在其中输入以下公式,然后按 输入 键。 选择结果单元格,然后拖动其 填充手柄 下来获得所有结果。

=LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1),",",""))+1


使用出色的工具轻松在单个单元格中计算逗号分隔的值

随着 计算以逗号分隔的单元格数 实用程序 Kutools for Excel,您可以轻松计算Excel中单元格中逗号分隔的值,而无需手动应用公式。

申请前 Kutools for Excel首先下载并安装.

1.选择一个空白单元格以输出结果。

2。 去 库工具 标签,点击 公式助手 > 公式助手。

3.在 公式助手 对话框,请进行以下配置。

  • 查找并选择 计算用逗号分隔的值的数量 ,在 选择一个公式 框;
    提示: 你可以检查 筛选器 框中,键入某些单词以过滤公式名称。
  • 手机 框,选择要在其中计算逗号分隔值的单元格;
  • 点击 OK 按钮。 看截图:

4.现在,结果将填充到所选单元格中。 选择此结果单元格,然后向下拖动其“填充手柄”以获取其他结果。 看截图:

  如果您想免费试用(30天)此实用程序, 请点击下载,然后按照上述步骤进行操作。


相关文章:

在Excel中计算一列中的重复值
如果您在工作表中有一个包含唯一值和重复值的数据列表,那么您不仅要计算重复值的频率,还想知道重复值的出现顺序。 本文中的方法可以帮您一个忙。

用Excel中的文本或数字对单元格进行计数
例如,您有一个包含文本和数字的工作表,并且想要分别计算文本和数字的单元格总数,您会怎么做? 在Excel中,可以使用公式来实现。 请浏览本教程以获取更多详细信息。

在Excel中计算单元格包含文本还是部分文本
假设您具有以下数据,并且想要分别计算包含文本“ Apple”的单元格数量,包含文本“ Orange”的单元格数量和包含“ Peach”的单元格数量,如何实现? 在本教程中,我们将详细介绍COUNTIF函数,以帮助您快速计算单元格中包含文本或Excel中特定文本一部分的单元数。 此外,我们引入了一个很棒的功能,只需单击即可轻松实现。

计算Excel中两个值或日期之间的单元格数
如果您需要计算包含两个数字或日期之间的特定值的单元格编号,CountIf函数的公式可以快速为您提供帮助。 在本教程中,我们将向您显示计算Excel中两个值或日期之间的单元格数量的详细信息。

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
To not show blank cells as 1, add an if statement using ISBLANK in the condition:=IF(ISBLANK(A1),0,LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1),",",""))+1)

or, if you prefer to avoid IF logic blocks in your sheet, use SIGN and LEN:=LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1),",",""))+SIGN(LEN(A1))


This comment was minimized by the moderator on the site
It returns a count of 1 from an empty cell. How do you fix this so it returns the count of zero??
This comment was minimized by the moderator on the site
what if some of the cells only have one value, e.g. cell A = KTW, cell B = VAL, SME how to count cell A?
This comment was minimized by the moderator on the site
How To Count Comma Separated Specific Values in a single cell In Excel?
Suppose to count how many 15's are there in a single cell that contains 10,1,15,20,15,5,15,155
I need the result 3.
Is there any formula in excel
This comment was minimized by the moderator on the site
This worked great for me but i had to edit formula for Office 2016. (TRIM(A1),",","")) replaced with (TRIM(A1);",";""))
This comment was minimized by the moderator on the site
Dear Shandoo,

Thank you for your supplement!
This comment was minimized by the moderator on the site
i have comma separated values in cells like A=1,2,3,4,5,6 B=3,4,5,6,7,8 I want to add the contents of the two cells without repeating the value and also want to get the common value of two cells expected result = 1,2,3,4,5,6,7,8 =3,4,5,6 i am not getting the exact formula in microsoft excel 2013 Kindly help me Thanks
This comment was minimized by the moderator on the site
have you found out the way to achieve this? i am looking for exactly the same thing. thanks
This comment was minimized by the moderator on the site
i too looking for the same
This comment was minimized by the moderator on the site
What if some of the cells underneath are blank? When using the fill handle on the rest of the cells it's coming up with 1 as the total.
This comment was minimized by the moderator on the site
Hello James55, don't know if you ever got an answer but in case you need one. Use an IF statement to check if the cell is blank and then print a "0" or null "" whichever you like. =IF(A1="","0",(LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1),",",""))+"1"))
This comment was minimized by the moderator on the site
Great share info
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations