如何求值在excel单元格中用分号分隔的值 [英] How to sum values seperated by semicolon in excel cell

查看:270
本文介绍了如何求值在excel单元格中用分号分隔的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



每个单元格中的值的数量为N(未知数),而不包含多个值,以分号分隔,它只能是一个值,也可以是20以上。



为什么我用分号分隔的值是每行代表我们正在销售的产品。在这行是包含该产品的销售价格的单元格。

示例
产品称为室内门以不同的价格出售三次,因此单元格包含三个值:102,5; 98 ,2; 101,00现在我需要总结这三个值来获得总价格(在哪个产品出售)。

解决方案

您可以使用以下公式:

 code> = eval(SUBSTITUTE(A1,;,+),,,。))

在您的工作簿中添加用户定义的函数后,

 函数eval )
eval = Evaluate(str)
结束函数


I have cell in excel that contains multiple values separated by semicolon, I need to sum each cell.

Number of values in each cell is N (unknown), it can be only one value or it can be 20 or more.

The issue why I have values separated by semicolon is that each row represents product that we are selling. In that row is cell that contains selling prices of that product.
Example Product called "indoor door" were sold three times at different price, so cell contains three values: 102,5;98,2;101,00 Now I need to sum those three values to get total price (at which product was sold).

解决方案

You can use following formula:

=eval(SUBSTITUTE(SUBSTITUTE(A1, ";", "+"),",","."))

after adding user defined function to your workbook:

Function eval(str As String)
   eval = Evaluate(str)
End Function

这篇关于如何求值在excel单元格中用分号分隔的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆