I have two cells with floating point numbers in them, generated by separate calculations. The numbers may be anywhere in the range of +- 1E+-307, as well as being zero.

I'm trying to determine a formula in a third cell which provides the number of consecutive matching mantissa digits in the two FP numbers for when the exponent digits are identical, starting from the 1st (most) significant digit, and working towards the 15th (least) significant digit. The result of the matching is to return a number from zero to 15. Should the numbers have different exponents, the number of matching digits returned must be zero.

The number of matching digits is to give an indication of the extent of the matching of the two numbers, such as 5 matching digits, 11 matching digits, etc. For two identical numbers, the matching digits number returned is 15.

I'm also needing a formula in a fourth cell which returns the absolute difference between the two numbers (as close as possible up to the 15th place!), regardless of whether or not the exponents are identical.

eg:
A1 = -1.23456789019876 E+00 FP Number 1
A2 = -1.23456789012345 E+00 FP Number 2
A3 = 11 (the exponents are the same, and the first eleven consecutive digits match)
A4 = 0.00000000007531 (the absolute difference)
= 7.53100000000000 E-11

I'd be most grateful for advice on the cell formulas needed in A3 and A4.

With my thanks.