View Single Post
  #10   Report Post  
Dawn Rhoads
 
Posts: n/a
Default

Ugh, sorry. The result should be $600 (with a total pages of 201 and a rate
of 200). The part where I wrote out the several examples trying to explain
the calculation is correct. Sorry about that.

I'll have to try the calculation again in the morning, I've looked at it
several times and re-entered it from scratch twice and can't find where my
mistake is. Turns out I get the value 100 no matter what I input I use for
total pages or the rate. I had deleted the line break, as you noted, and I
am entering the braces with control-F9, so that's not it.

Can you describe what the "round" function actually does? Is it round up
for decimals .5 and higher and round down for .4 and lower or something?

Thanks again for your help!



"Greg Maxey" wrote:

Dawn,

Our posts are crossing. The original formula I provided returns 404. You
must have made a typo somewhere.

Then you said that for the value of 201 and 200 you want to round up the
2.02 to 3 so the result should be 600. The second formula I provided will
round up (it is a combination round and mod forumal) 2.02 to to and return
600 for values Total 201 and Rate 200. Now you are saying that it should be
400. Which is it??

Here is the formula to return 600 for values Total 201 and Rate 200: Note
the forula is broken by text wrapping so bring the =round back up to the
same line.

{ IF a1 "100""{
=(round((((a1-100)/50)+(MOD(((a1-100)/50),1)0)/2),0)*b1)}""0"}

--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

Dawn Rhoads wrote:
Hmmm... yep, rounding definitely seems to be the culprit. Do you
know what exactly the "round" feature does? A fellow here thinks he
can determine mathmatically what we need to do, regardless of how the
rounding actually works, as long he knows what the rounding will
actually do.

When I tried your IF field, I got a result of $100, when I entered a
total pages of 201, with a rate of 200. (Is that what you get, or
have I entered the calculation incorrectly?) That isn't right. What
it should be is $400. I probably haven't explained the math very
clearly. For every 50 pages over 100, there is a fee of $200. So,
0-100 pages gets $0 fee. 101-150 pages get a $200 fee. 151-200
pages gets a $400 fee. 201-250 gets a $600 fee, etc.

Thanks again for any help you can offer!

"Greg Maxey" wrote:

Dawn,

This one is not as easy as you might expect. This is due in part to
the fact that Word has no Round Up function.

I didn't have time to refine this but it will work. For the purpose
of this example, lets put Total in cell a1 and put Rate in Cell b1

The formula
{ IF a1 "100""{
=round((((a1-100)/50*b1)+(MOD(((a1-100)/50*b1),1)0)/2),0) }""0"}

should work. Note the field braces { } must be entered with CTRL+F9
--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

Dawn Rhoads wrote:
I am trying to insert an if calculation into a Word table. It will
reference two other fields in other locations in the table. One is
a number of pages (let's call that "Total"). Another is a rate
("Rate"). We think we have the math figured out, but I don't have
enough experience with IF and calculation fields to figure this out
very easily.

We also think it will use the "round" function, which we think means
if a number in our calculation is a decimal, it will be rounded up
to
the nearest whole number.

IF the Total100, then round (Total-100)/50*Rate, ELSE 0.

Any thoughts would be greatly appreciated. Thanks!