Share via

IFERROR replacement for Access

Anonymous
2019-01-30T10:24:41+00:00

I have this formula in my P&L report that works where we have Sales and Costs for the month. If there are no sales AND no costs it will result in #NUM! and where there are no sales OR no costs it will result in #DIV/0!. Is there a similar formula to IFERROR where I can say if the formula results in an error, give "0". 

=Sum(IIf([Grouping3]="2.Controllable Costs",[TY Mth],0))/-Sum(IIf([Grouping2]="01.Net Sales",[TY Mth],0))

I have tried different variants of Nz( ), IIf(IsError( ) and IIf(<formula>=0,0,<formula>) and they haven't worked. 

Thank you,

Chantelle

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2019-01-30T11:05:49+00:00

    =IIf(Sum(IIf([Grouping2]="01.Net Sales",[TY Mth],0))=0,0,Sum(IIf([Grouping3]="2.Controllable Costs",[TY Mth],0))/-Sum(IIf([Grouping2]="01.Net Sales",[TY Mth],0)))

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-01-30T14:40:07+00:00

    =IIf(Sum(IIf([Grouping2]="01.Net Sales",[TY Mth],0))=0,0,Sum(IIf([Grouping3]="2.Controllable Costs",[TY Mth],0))/-Sum(IIf([Grouping2]="01.Net Sales",[TY Mth],0)))

    That worked a charm - thank you!

    Was this answer helpful?

    0 comments No comments