View Single Post
  #2   Report Post  
Posted to microsoft.public.word.tables
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Problem with an If Formula

Hi Holly,

For a formula like =D2/B2, the divide by 0 test needs to apply to B2, not D2. Your existing IF test looks at D2.

Subject to the above, you could code the formula like:
{IF{=B2}= 0 "" {=D2/B2*100 \# "0%;(0%)"}}

--
Cheers
macropod
[MVP - Microsoft Word]


"Holly" wrote in message ...
Hey everyone,

I'm working on a table for a mail merge where all the information for the
table is pulled from an Excel spreadsheet except for the totals and
calculating the percentage of available balance. I'm trying to do an If
formula to account for !Zero Divide error. My data has a lot of 0's, so it's
kinda of hard to avoid. This is what I've tried and the value "if false"
part of the statement won't execute. Any help is greatly appreciated. This
is what I want the formula to do: If D2=0, leave the cell blank, else
(D2/B2)*100 and I want the else part of the formula to be formatted as a %.

{ If {D2} = 0 " " {=(D2/B2)*100} \#"0%";(0%)"}