Apr 26 2023 10:49 AM
Apr 26 2023 10:49 AM
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 Cell T2 to return "2.00" after adding the figures in Cell S2. It is important to keep the format of S2 as close as possible, as they line up with another field's data.
We are using Microsoft Office Standard 2016, with Windows 10 Pro, Version 22H2.
Thank you very much!
Apr 26 2023 10:54 AM
@Deleted
Try this one:
=SUM(1*TEXTSPLIT(S2,CHAR(10)))
Apr 26 2023 11:10 AM
Apr 26 2023 11:17 AM
Apr 26 2023 11:18 AM
Apr 26 2023 11:48 AM - edited Apr 26 2023 11:49 AM
@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)
Apr 26 2023 12:03 PM
Apr 26 2023 12:11 PM - edited Apr 26 2023 01:09 PM
You might have more non-number characters in that cell besides the carriage return. You could use:
=LEN(S2)
This will determine the length of how many characters are in the cell.
Apr 26 2023 12:20 PM
Solution@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.
Apr 26 2023 01:24 PM
@Patrick2788 Thank you for your help! I appreciate you!
Apr 26 2023 01:25 PM