NUM! error with Nz function

  • Thread starter Thread starter Nick Mirro
  • Start date Start date
N

Nick Mirro

Data source for text control:

=((Nz([CPT1PaymentTotal],0)+Nz([CPT2PaymentTotal],0)+Nz([CPT3PaymentTotal],0
)+Nz([CPT4PaymentTotal],0)+Nz([CPT5PaymentTotal],0)+Nz([CPT6PaymentTotal],0)
)/(Nz([TotalBilled],0)))

Returns "NUM!" If values in source fields are null.

Shouldn't all these Nz's prevent this?
 
You have a divide by 0 error. The last division will always cause an error.
Change the last NZ to use 1 instead of 0 so that you don't get a divide by
0.

Kelvin

Nick Mirro said:
Data source for text control:

=((Nz([CPT1PaymentTotal],0)+Nz([CPT2PaymentTotal],0)+Nz([CPT3PaymentTotal],0
)+Nz([CPT4PaymentTotal],0)+Nz([CPT5PaymentTotal],0)+Nz([CPT6PaymentTotal],
0)
)/(Nz([TotalBilled],0)))

Returns "NUM!" If values in source fields are null.

Shouldn't all these Nz's prevent this?
 
Back
Top