[英]how to add comma separated numbers in excel column?
As you already solved this without VBA you could also use a User Defined Function由于您已经在没有 VBA 的情况下解决了这个问题,因此您也可以使用用户定义的函数
Function mySum(s As String, del As String)
Const Plus = "+"
s = Replace(s, del, Plus)
mySum = Evaluate(s)
End Function
You would use it like that你会像那样使用它
=mySum(A1,",")
Assuming you have your comma-separated values in cell A1, the following array formula will add all such values:假设您在单元格 A1 中有逗号分隔的值,以下数组公式将添加所有这些值:
=SUM((TRIM(MID(SUBSTITUTE(A1,",",REPT(" ",255)),1+(ROW(A1:A999)-1)*255,255)) & "0")/10)
To properly return the formula, you need to press CONTROL+SHIFT+ENTER
, instead of just the usual ENTER
.要正确返回公式,您需要按
CONTROL+SHIFT+ENTER
,而不仅仅是通常的ENTER
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.