Find Percentage Of Two Values (Div/zero Errors!) Follow
I have two price values stored as double that I want to compare and then print the percentage difference if it is more than 15% of the comparison price (CompPrice).
My current attempt is:
IIF(CompPrice<>0,IIF(CDbl(CompPrice - Price)>=CDbl(CompPrice*0.15),(100-((100/CompPrice)*Price)),0),0)
I keep getting a div/zero error though as CompPrice is sometimes zero. I thought that the first IIF would capture this and exit the statement but it doesn't seem to work like that?
I also want to round the result down to the nearest 5 but I don't know how to do this without adding more IIF statements!
Please sign in to leave a comment.