"joeu2004" wrote:
> On Nov 24, 2:56 pm, CB <C...@discussions.microsoft.com> wrote:
> > It also works if I use ROUND in C1:C3 and change D4 accordingly:
> > =IF(C4="","",IF(C4>0.5,"TOO HIGH",IF(C4<-0.5,"TOO LOW","O.K.")))
>
> This is closer to the right approach. I would also round the average,
> computed in C4. So the formulas should be (presumably C1 is copied
> into C2 and C3):
>
> C1: =IF(A1="","",ROUND(B1-A1,1))
>
> C4: =IF(C1="","",ROUND(AVERAGE(C1:C3),1))
Good to know I was on the right track.
> Regarding your first posting, you wrote:
> > numbers in A1:B3 are entered with only one decimal place
>
> But unfortunately, most of the time, WYSI-not-WYG when it comes to
> numbers with decimal fractions. Most such numbers are not stored
> exactly internally. This leads to small numerical "errors". This is
> a limitation of the technology that Excel relies on -- as do most
> applications (but not all).
>
> In your example, the problemmatic numbers are in A3:B3. 16.1 and 15.6
> are stored internally as exactly
> 16.10000000000000142108547152020037174224853515625 and
> 15.5999999999999996447286321199499070644378662109375. When they are
> subtracted, the result is exactly
> 0.5000000000000017763568394002504646778106689453125.
Interesting!
> As you can see (and you learned empirically), the result is not
> exactly 0.5. In fact, Excel will display it as 0.500000000000002 when
> formatted as Number with 15 dp.
>
>
> Regarding your first work-around, you wrote:
> > =IF(C4="","",IF(ROUND(C4>0.5,1),"TOO HIGH",
> > IF(ROUND(C4<-0.5,1),"TOO LOW","O.K.")))
>
> That is nonsensical. For example, you are rounding the boolean result
> of C4>0.5, which is 0 or 1. I suspect you want to write:
>
> =if(C4="", "", if(round(C4,1)>0.5, "TOO HIGH", ...etc...)))
I thought it seemed rather odd when I was playing around with the formula
but it ***seemed*** to work. I didn't spend a lot of time playing with that
formula when I decided to use round in the other forumlas instead.
> Perhaps you did just that in your spreadsheet, and you simply had a
> typo when you entered the formula into your posting. Always cut-and-
> paste examples to avoid such mistakes in the future.
I believe I did have that in my spreadsheet (briefly) but in looking at it
again I can see why you say it is nonsensical.
Thanks for your feedback. I do appreciate it.
Chris
> HTH.
>