You could use an IF function. You can learn all about functions in this document:
That you can find here:
The function to deternime if a field is empty is simply
The If statement allows you to have two different kinds of outcomes depending on a condition.
In your case the condition would be whether if one of the fields is empty or not.
This is the format:
So you could say:
If (IsEmpty (FirstVolume) or IsEmpty (SecondVolume) ; "0" ; ((first volume - second volume) / first volume) * 100 )
That means that if the field "FirstVolume" OR the Field "SecondVolume" is empty ; the result will be "0" ; If neither of the two fields is empty, so if they are both filled in, the result is your calculation.
Good point , though that will imply that an attempt was made to reduce the volume and it caused a change of zero as far as the average is concerned.
thanks for the tip regarding If whcih i will look through.
If you want the field to remain empty instead of show a zero you just remove the zero and keep:
If (IsEmpty (FirstVolume) or IsEmpty (SecondVolume) ; "" ; ((first volume - second volume) / first volume) * 100 )
Or if you use the other calculation (mine)
If (IsEmpty (FirstVolume) or IsEmpty (SecondVolume) ; "" ; SecondVolume / FirstVolume )
perfect thank you.