Hi
basically because excel can only handle 15 significant figures and you've
got 20, however, here's a UDF that you can use to find the difference
between the two numbers as long as the value you put in first is greater
than the value you put in second and the two text strings are the same
lengths.
Please note, this isn't fully tested so please check your results carefully.
'----------
Function subtracttext(firstval As String, secondval As String)
If Len(firstval) <> Len(secondval) Then
MsgBox "values need to be of same length"
Exit Function
End If
k = 0
For i = Len(firstval) To 1 Step -1
a = Mid(firstval, i, 1)
b = Mid(secondval, i, 1)
If Int(a) - k <> Int(b) Then
If Int(a) - k > Int(b) Then
j = CInt(a) - k - CInt(b)
k = 0
Else
j = CInt(a) - k + 10 - CInt(b)
k = 1
End If
Else
j = 0
k = 0
End If
Output = Output & j
Next
subtracttext = Int(StrReverse(Output))
End Function
'-----------
please post back if you need help using this UDF.
Regards
JulieD