Basic Formula help - InfoPath Dev
in

InfoPath Dev

Basic Formula help

Last post 10-15-2010 03:19 PM by abiigdog. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 10-14-2010 08:52 PM

    Basic Formula help

    I have several fields summed and sent to a field called SumSection. I have a AverageScore field that is a text box that I want to average the result of the SumSection field. I can do the average fine by using (Sumsection) / 12, twelve being the number of fields. But how do I round the result? I just can't figure out how to string together then average formula and have it round before displaying the input. Want it to round to the nearest whole number, no fractions.

     Anyone able to tell me what exactly I would type into the Fx box?

  • 10-14-2010 09:24 PM In reply to

    How about using the round() function? :-)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-14-2010 09:44 PM In reply to

    Well I could but then I wouldn't have the average, need it to average then round in the same expression.

  • 10-14-2010 10:03 PM In reply to

    What if you round the average?

    round(sumsection div 12)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-14-2010 10:47 PM In reply to

    I tried that but I think I have the syntax wrong or it doesn't work. Tried  Round(Sumsection / 12) do I need to use the "div" instead of the divide symbol?

  • 10-14-2010 10:52 PM In reply to

    Nevermind tried it just turns the div to the symbol anyways. It displays a number but not a correct one. using two values of 2 and 4 it tells me the average is 1 instead of 3, still stumped.

  • 10-14-2010 11:38 PM In reply to

    Are you still dividing by 12 when you use the values 2 and 4?  If so, 1 is the expected result:

    (2 + 4) / 12 ->    0.5   (round)->  1

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-15-2010 03:19 PM In reply to

    Yes your right that's what it's doing. I guess I need to do a count operation when the value is greater then zero, and further down the rabbit hole I go.

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.