Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
示例:单元格中的字符串
1 1 1 1(总共应该是4) 0.5 0.5(总计应为 1) 0.125 0.125(总计应为 0.250) 0.125 0.0625 8 1(总计应为 9.1875)
首先使用 Text To Columns 将单个数字放入单个单元格中。然后在各个数字上使用 =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