ilfocorp
asked on
IF Statement
Hello, I am trying to get my syntax right in this report textbox equation. Can someone help get the commas and/or paranthesis right. My goal is to make sure that I'm not trying to subtract or divide with zero. Thanks.
Current Script Blowing Up:
=sum(iif([ps1_bkfst_food] <> 0,([ps1_bkfst_food]-[ps13_ bkfst_food ])/[ps1_bk fst_food]) ,0))
Current Script Blowing Up:
=sum(iif([ps1_bkfst_food] <> 0,([ps1_bkfst_food]-[ps13_
select sum(iif([ps1_bkfst_food] <> 0,([ps1_bkfst_food]-[ps13_ bkfst_food ])/[ps1_bk fs_food],0 ))
try this
try this
You had a extra paren on the end ... if that's what you mean by blowing up?
mx
mx
And maybe this:
=IIf([ps1_bkfst_food] = 0, , 0, sum(([ps1_bkfst_food] - [ps13_bkfst_food]) / [ps1_bkfst_food]))
=IIf([ps1_bkfst_food] = 0, , 0, sum(([ps1_bkfst_food] - [ps13_bkfst_food]) / [ps1_bkfst_food]))
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone. This is the solution that actually worked. I got errors all the other solutions but appreciate the support and effort.
How about this:
=sum(IIf([ps1_bkfst_food] <> 0, ([ps1_bkfst_food] - [ps13_bkfst_food]) / [ps1_bkfst_food]), 0)
mx