Find nearest value
Your example is indeed what I need. However, I could not
make the formula work.
I pasted the fractions in A8 to A14. The formula substitutions
gave me:
=INDEX(ROUND(.47682*2^(ROW(INDEX(A:A,1):INDEX(A:A, 8))-1),0)/2^(ROW(INDEX(A:A,1):INDEX(A:A,8))-1),MATCH(min(ABS(a1-ROUND(input*2^(ROW(INDEX(A:A,1):INDEX(A:A,8))-1),0)/2^(ROW(INDEX(A:A,1):INDEX(A:A,8))-1)),0))
which gave me the error Too few arguments.
Would it be simpler to place the 2^x fractions in a different column?
--
Occasionally stumped
"Herbert Seidenberg" wrote:
For denominators 2, 4, 8, 16, 32, 64 and 128,
depending on the closest match, as in these examples:
0.476823 61/128
0.513072 33/64
0.158690 5/32
0.689468 11/16
0.877029 7/8
0.746163 3/4
0.501050 1/2
Insert Name Define
input Refers to: 0.476823
bse Refers to: =2^(ROW(INDEX(A:A,1):INDEX(A:A,8))-1)
mult Refers to: =ROUND(input*bse1,0)/bse1
err Refers to: =ABS(input-mult)
merr Refers to: =MIN(err)
Paste this array formula into a cell next to input:
=INDEX(mult,MATCH(merr,err,0))
and Format Cells Fraction Up to 3 digits
|