使用参考公式的同一单元格中的3个数字的总和 [英] Sum of 3 numbers in same cell using a reference formula as well

查看:92
本文介绍了使用参考公式的同一单元格中的3个数字的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在B1我有:3,4,5
IN B2我有这些数字的总和12



我想把这些加在一起,在B3中出现的总和



所以,对于B3,我需要告诉excel来引用保存数字的单元格,然后将它们添加在一起。这样,一旦我创建了原来的公式,我可以拖动它剩下的单元格。



原因是:这些数字(B2)的总和是拉总和从电子表格中的不同位置。我需要确保这些数字匹配。



谢谢

解决方案

替代解决方案(如果三个数字用逗号分隔):

  = SUMPRODUCT( -  MID(SUBSTITUTE(B1, ,,REPT(,99)),99 *(ROW($ 1:$ 3)-1)+1,99))

或者,为了使公式更加动态,以便B1单元格可以有任意数量的数字,只要它们以逗号分隔:

  = SUMPRODUCT( -  MID(SUBSTITUTE(B1,,,REPT(,99)),99 *(ROW(INDIRECT(1: LEN(B1)-LEN(替补(B1,,))+ 1)) -  1)+1,99))


IN B1 I have: 3,4,5 IN B2 I have the sum of these numbers 12

I would like to add these together and the sum to appear in B3

So, for B3, I need to tell excel to reference the cell holding the numbers, then add them together. This way, once I create the original formula, I can drag it through the remaining cells.

Reason is: The sum of these numbers (B2), are pulling the sum from a different location within the spreadsheet. I need to make sure these numbers match.

Thank you

解决方案

Alternate solution (if exactly three numbers separated by a comma):

=SUMPRODUCT(--MID(SUBSTITUTE(B1,",",REPT(" ",99)),99*(ROW($1:$3)-1)+1,99))

Or, to make the formula more dynamic so that the B1 cell can have any quantity of numbers, as long as they are separated by a comma:

=SUMPRODUCT(--MID(SUBSTITUTE(B1,",",REPT(" ",99)),99*(ROW(INDIRECT("1:"&LEN(B1)-LEN(SUBSTITUTE(B1,",",""))+1))-1)+1,99))

这篇关于使用参考公式的同一单元格中的3个数字的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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