Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
955 views
in Technique[技术] by (71.8m points)

excel - Sum of 3 numbers in same cell using a reference formula as well

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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))

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...