Forum Discussion
Deleted
Apr 26, 2023Adding multiple values in a single cell to create a sum in an empty cell
Hello! I am trying to create a formula in which an empty cell returns the sum of values entered in the previous cell. For example, Cell S2 has "1.00 (alt+enter) 1.00 (alt+enter)" and I would like Cel...
- Apr 26, 2023
Deleted
Try this:
Select T2.
On the Formulas tab of the ribbon, click Define Name.
Enter Total in the Name box, and in the Refers to box, enter the formula
=EVALUATE(SUBSTITUTE(LEFT(!S2,LEN(!S2)-(RIGHT(!S2)=CHAR(10))),CHAR(10),"+"))
Click OK.
Enter the formula =Total in T2.
This can be filled down if required.
Patrick2788
Apr 26, 2023Silver Contributor
Deleted
Try this one:
=SUM(1*TEXTSPLIT(S2,CHAR(10)))
Deleted
Apr 26, 2023Hi Patrick2788. Thank you! I'm getting the #NAME? error.
- Patrick2788Apr 26, 2023Silver ContributorWhich version of Excel are you using? It seems to be something other than 365.
- DeletedApr 26, 2023We are using Microsoft Office Standard 2016.
- Patrick2788Apr 26, 2023Silver Contributor
Deleted
This formula will pull up to 4 numbers and sum them. Another option might be FILTERXML but with no spilling there's going to be some messy extraction either way.
=IFERROR(LEFT(S2,FIND(CHAR(10),S2)-1)*1,0)+IFERROR(MID(S2,FIND(CHAR(10),S2)+1,FIND(CHAR(10),S2,FIND(CHAR(10),S2)+1)-(FIND(CHAR(10),S2)+1))*1,0)+IFERROR(MID(S2,FIND(CHAR(10),S2,FIND(CHAR(10),S2)+1)+1,FIND(CHAR(10),S2,1+FIND(CHAR(10),S2,FIND(CHAR(10),S2)+1))-(FIND(CHAR(10),S2,FIND(CHAR(10),S2)+1)+1)),0)+IFERROR(MID(S2,FIND(CHAR(10),S2,1+FIND(CHAR(10),S2,FIND(CHAR(10),S2)+1))+1,10)*1,0)