# Thread: calculation display/field in form (XP)

1. ## calculation display/field in form (XP)

I have a form with some calculations. The calculation is in column C, and it's just A2*B2. Col A is a fill field and column B is something like \$3.00. So in Col C the answer to the calculation comes out like \$6.00. My question is - is there any way to have column C be blank if there is no calculation being done. The user would like to be able to print this form out and use, or fill it out online. But you can't really print it out because the calculation fields have a default of \$0.00. If I set the number format to \$####.## I still get the dollar sign and decimal, which I need, so I can't just put ####.
Is there any way around this? I need the dollar sign and decimal if there IS a calculation, but if it's empty I want the field to appear blank. Thanks.

2. ## Re: calculation display/field in form (XP)

Can you try nesting the calculation fields inside an If field along the lines of {IF A2=0,"\$ . ",A2*B2}

3. ## Re: calculation display/field in form (XP)

Would the following syntax work for you?

{ =a2*b2 # \$#.xx;-\$#.xx;}

or { =a2*b2 # \$#.00;-\$#.00;}

You separate the positive, negative, & zero formats with semi-colons.

4. ## Re: calculation display/field in form (XP)

Thank you both for your suggestions! I tried all of them and the one I got to work was =A2*B2# \$#.00;-\$#.00;

I went to Edit Formula and typed that in the Formula line. I closed out of that and tested it and it worked! When I went back to Edit Formula and looked at it, in the Formula line was A2*B2 and then in the Number Format was \$#.00;-\$#.00;

So it adjusted itself to that, but my question is --- can you explain that to me? I see it's the format for positive or negative entries, but how does it know to leave blank if there is no calculation going on? Is it saying for a positive use this, for a negative use this.....but if there isn't any positive or negative it's just blank by default because there isn't either choice? I guess my question is, why doesn't it leave a blank when I use some of the default number formats, but with this it does leave a blank if the field is null?

Thanks again, this is great!

5. ## Re: calculation display/field in form (XP)

The numeric picture format gives a format for positive, negative, & zero results, in that order. They are separated by semi-colons. Since I put nothing after the second semi-colon, then a zero result has nothing displayed. You'll note that I have two semi-colons so that Word knows I'm specifying a format for the result of zero.

If you press F1 to bring up Word help & search for switches, you'll see Numeric Picture (#) switches. Clicking this should give you an explanation of the formatting results. In case you can't find it, I've copied it as an attachment.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•