NUM! error with Nz function

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?
 
K

Kelvin Lu

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top