Function SumPro(Num1 As String, Num2 As String) As String
Dim i%, Mx%, Mn%, Output$, Result$, Comment$, Dec$
Num1 = Format(Num1, IIf(InStr(Num1, "E"), "#", "@")): Num2 = Format(Num2, IIf(InStr(Num2, "E"), "#", "@"))
Dec = Val(Mid(Num1, InStr(Format(Num1, "#."), "."))) + Val(Mid(Num2, InStr(Format(Num2, "#."), ".")))
Num1 = StrReverse(Mid(Num1, 1, InStr(Format(Num1, "#."), ".") - 1)): Num2 = StrReverse(Mid(Num2, 1, InStr(Format(Num2, "#."), ".") - 1))
If Len(Num1) > Len(Num2) Then Mx = Len(Num1): Mn = Len(Num2) Else Mx = Len(Num2): Mn = Len(Num1)
GoSub Deci:
If Dec >= 1 Then Num1 = Result: Num2 = Int(Dec): Result = "": Mx = 1: Mn = 1: Dec = Dec - 1: GoSub Deci
If Dec > 0 Then Result = Result & Mid(Dec, 2)
SumPro = Result
Exit Function
Deci:
For i = 1 To Mx
If Comment = "" And i > Mn Then Exit For
Output = Val(Mid(Num1, i, 1)) + Val(Mid(Num2, i, 1)) + Val(Comment)
Result = Right(Output, 1) & Result
Comment = Mid(StrReverse(Output), 2)
Next i
Result = StrReverse(Mid(Num1, i)) & StrReverse(Mid(Num2, i)) & Result
Return
End Function
Hi again I downloaded the file .Maybe I didn't get well, When I add a number between 15 digits ,it puts 0 at the end.hi ,
You had to upload a simple file as desired
But I did an example for you with two methods of solving ... one with a simple equation and the other with a knowledge function SumPro
Hi, Yes I tried both ways using text format or an apostrophe. It lets us to see whole numbers more than 15 but I can't calculate things with it. I searched for this issue. Most of the Sites say it is impossible to cause of excel only lets 15 digits to calculate. It doesn't let scientific calculationDid you enter the so-called 'numbers' as text rather than allowing Excel to convert it to (the binary representation) a number? The cell should have a number format of 'text' or prefixing it with an apostrophe could work.
For i = 1 To Mx + 1
If Comment = "" And i > Mn Then Exit For
Output = Val(Mid(Num1, i, 1)) + Val(Mid(Num2, i, 1)) + Val(Comment)
Result = Right(Output, 1) & Result
Comment = Mid(StrReverse(Output), 2)
Next i