示例:单元格中的字符串
1 1 1 1 (total should be 4) 0.5 0.5 (total should be 1) 0.125 0.125 (total should be 0.250) 0.125 0.0625 8 1 (total should be 9.1875)
答案 0 :(得分:1)
首先使用“文本到列”将单个数字转换为单个单元格。然后在各个数字上使用= SUM()函数。
修改#1 强>
如果您需要VBA解决方案,请考虑:
Public Function AddCell(s As String) As Variant
ary = Split(Trim(s), " ")
AddCell = 0
For i = LBound(ary) To UBound(ary)
AddCell = AddCell + ary(i)
Next i
End Function