Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    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}
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #4
    Star Lounger
    Join Date
    Feb 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Attached Files Attached Files

Posting Permissions

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