IF Error Function

D

Denver

Hi,

=IIf([Done]="NA","",(IIf([Done]<>"NA",([Done])/(Sum([RLApproved])))))

I have this as my COntrol Source to one of my report.
Is there anyway to avoid a result of #Num!, the formula is working
will but it only result to some as #Num! when [RLApproved] = 0.

I want to replace that result 0.00% instead of #Num!. what do I need to add
from my formula?

thanks for any help, I appreciated
 
M

[MVP]

Hi,

=IIf([Done]="NA","",(IIf([Done]<>"NA",([Done])/(Sum([RLApproved])))))

I have this as my COntrol Source to one of my report.
Is there anyway to avoid a result of #Num!, the formula is working
will but it only result to some as #Num! when [RLApproved] = 0.

I want to replace that result 0.00% instead of #Num!. what do I need to add
from my formula?

thanks for any help, I appreciated

=IIf([Done]="NA","",(IIf([Done]<>"NA",(NZ([Done], 0)/Sum(NZ
([RLApproved], 0)))))

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
A

Allen Browne

Try something like this:
=IIf(([Report].[HasData] = False) OR (Sum([RLApproved]) = 0)
OR ([Done] = "NA") OR ([Done] Is Null), Null,
Val([Done]) / Sum([RLApproved]))

[Done] must be a Text type field if it can contain NA, so you need to use
Val() to get the value. Val() can't handle Null, so you need to test for
Null as part of the condition. Division by zero causes error, so you need to
test for that condition. If there are no records in the report, the
expression will generate an error, so you have to test for that also.

You may need to sort out the bracketing.
 
D

Denver

Thanks, Allen Browne

Allen Browne said:
Try something like this:
=IIf(([Report].[HasData] = False) OR (Sum([RLApproved]) = 0)
OR ([Done] = "NA") OR ([Done] Is Null), Null,
Val([Done]) / Sum([RLApproved]))

[Done] must be a Text type field if it can contain NA, so you need to use
Val() to get the value. Val() can't handle Null, so you need to test for
Null as part of the condition. Division by zero causes error, so you need to
test for that condition. If there are no records in the report, the
expression will generate an error, so you have to test for that also.

You may need to sort out the bracketing.
--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Denver said:
Hi,

=IIf([Done]="NA","",(IIf([Done]<>"NA",([Done])/(Sum([RLApproved])))))

I have this as my COntrol Source to one of my report.
Is there anyway to avoid a result of #Num!, the formula is working
will but it only result to some as #Num! when [RLApproved] = 0.

I want to replace that result 0.00% instead of #Num!. what do I need to
add
from my formula?

thanks for any help, I appreciated
 

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