View Single Post
  #4  
Old June 22nd, 2007, 01:15 PM posted to microsoft.public.word.tables
Graham Mayor
external usenet poster
 
Posts: 18,297
Default calculations in tables

Plan B

{ IF{ =A3 } 9 "{ =({ =INT({ =(A3)/10 }) } + {=(A3) \# "x"})}" "{ =A3 }" }


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


LM wrote:
In cell A3, I am calculating the number 2 by the value in cell A2.
The value in cell A2 can only be 0 to 9 (a single digit number). If
the total that ends up in cell A3 is two numbers, I want it to add
those two numbers together and put them in cell A4. If the total
that ends up in A3 is a single number, I want that single number in
cell A4.

Your calculation worked perfectly until I got up to the numbers 8 and
9 in cell A2 (which total 16 and 18 in cell A3 and should put 7 or 8
in cell A4).

Nearly there!!


"Graham Mayor" wrote:

The following placed in cell A4 will probably do the trick

{ IF { =A3 } 9 "{ ={ =ROUND(A3,-1) } /10 + (A3 - { =ROUND(A3,-1)
}) }" "{ =A3 }" }

Note that the curly brackets are places with CTRL+F9 (each pair)
Note also that such fields will not automatically update. You must
force an update when the content of cell A3 changes. the simplest
method is to attach an update macro to a toolbar -
http://www.gmayor.com/installing_macro.htm Note A3 in the
calculation is a table cell location and not a REF field.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


but note that

LM wrote:
I am doing calculations in tables in Word but am having trouble with
part of the calculation. In cell A4, I want to insert multiple IF
tests. I want to say that if cell A3=10, make the number in cell
A4=1, if cell A3=12, make the number in cell A4=3, if cell A3=14,
make the number in cell A4=5, etc., etc. Cell A3 could calculate to
any of five numbers and basically if it calculates to a double
number, I want it to add the two numbers together and put a single
number in cell A4. If, however, cell A3 is only a single number, I
just want that single number copied to cell A4.

Can someone please tell me how to do this. I have limited knowledge
of calculations in Word and am just learning as I go along. So far
I have managed but this one has got me beaten.

Thanks in anticipation of any replies.