First, whatever you calculate using report definition is accessible to your UDF ... I don't have access to the manual now to get you the macro, but search for it in the manual. You can just get the value and report it in your files.nSecond, I suspect that you did a very common mistake ... Did you set p_sum = 0 before starting the loop every time ? I can't answer because I can't see the rest of the codenThird, make sure that you selected total pressure in the report definition, so you compare total pressure to total pressurenn